Index
Would you like to react to this message? Create an account in a few clicks or log in to continue.

~ Project BlackBox ~

+4
Tuff Tiga
Christmas
Inhaps
Gecko
8 posters

Go down

~ Project BlackBox ~ Empty ~ Project BlackBox ~

Post by Gecko 31/7/2014, 4:54 am

So I was chilling  Cool Xmas knows whats up. And while I was pondering I came up with an amazingly fantastic plan of awesomeness. I will make me a coffee table. "A coffee table?!?" you say, "But, how is that programming?" Well quiet the plop up and I will describe. While pondering I thought, "Who doesn't love the classics?" Of course you say, "No one!" I have taken this into account! So let me present the idea!

Retro Game Table!!!!!!
~BrickBreaker
~Pong
~Tetris
~Snake
~Space Invaders
~Flobbin' Simon!

This table is all. 32 x 32 LED display 1024 seperate LED's 3 different colors equaling 3072 LED's. But the coolness doesn't there. 192 74HC595 BitShift registers 3 Arduino Mega's and  Retrograde Controllers!

How you may ask is this programming? Well if you know anything about Arduino, is that it is a microcontroller. Fancy term for tiny computer. I am programming, designing and building this table. I plan on updating every few days so check back for awesomeness!

ETA: August 30th

Currently owned:
~200 bitshift registers, Cost: $60
~200 DIP 16pin mounts, Cost: $15
~1200 RGB Common Cathode LED's, Cost: $70
~1 Arduino Mega, Cost $75
~1 Sheet of Acrylic, $21
~5  PCB's(Prototypes) $47

Total Cost: $288

Not cheap at all... But globbin' AWESOME!!!

Table of Contents:
1.0 - Intro
1.1 - C Header Files
1.2 - C Source Files
1.3 - Newly learned Programming Concepts
1.4 - Physical Table Progress


Last edited by Gecko on 20/8/2014, 2:38 am; edited 6 times in total
Gecko
Gecko
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Gecko 31/7/2014, 4:54 am

So what I have here is theoretically a library... theoretically. It is set up like one, but it actually follows the practice of a framework. This is making it way easier, without a framework every time I wanted to write a single led, I would have to put:
Code:
 for(int i = 0; i < 8; i++)
{
   digitalWrite(latch, LOW);
   shiftOut(data, clock, LSBFIRST, dataSent);
   digitalWrite(latch, HIGH);
}
If I wasn't a lazier and more efficient man, I would do this, but that is lame. So, Instead I have led.h and led.c which make functions to make this flobbin' easy. Of course, writing one led at a time is extremely inefficient... or is it. This is where the table is really cool, it takes advantage of Persistence of Vision, pretty much how the table take advantage of this is your mind sees the led on and off repeatedly giving the appearance of being on consistently.

Why?, you may ask. Well, its the only possible way. Humans think in a linear pattern, and much to that trend so do our programming languages. C++ is no exception, well sort of. You can multi-thread which is the option of using many CPU cores, that would be awesome and perfect to do on Arduino, except it only has one CPU core so I can only write one pin at a time... but that's fine in fact computers that have one CPU core seem to run many things at one time.. why? Becuase humans are flobbin' awesome, my Arduino Mega has a 16 MHz CPU, that is 16,000,000 calculations per second. So only one led is ever on at a time, but who cares.
ambient.h:
brickbreaker.h:
input.h:
led.h:
maze.h:
music.h:
pong.h:
simon.h:
snake.h:
spaceinvader.h:
startup.h:
stdafx.h:
tetris.h:


Last edited by Gecko on 20/8/2014, 2:53 am; edited 5 times in total
Gecko
Gecko
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Gecko 31/7/2014, 4:54 am

led.c:
ambient.c:
brickbreaker.c:
input.c:
maze.c:
music.c:
tetris.c:
startup.c:
spaceinvader.c:
snake.c:
simon.c:
screen.c:
pong.c:


Last edited by Gecko on 20/8/2014, 2:49 am; edited 2 times in total
Gecko
Gecko
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Gecko 31/7/2014, 4:55 am

Classes:
~These are newly learned concept to me and are really awesomely awesome. A class easily allows me to, rather than having any function be used anywhere and making overloading a function confusing, I can just call gfx.PutPixel(x, y, TRUE); This also allows me to keep functions that are only needed for certain function, only to be used by those functions.

BitWise Operators:
~Up until this project, I never really understood these, and the little knowledge I did have about them was questioning why I would ever need it. But I will give a small example of why these are helpful.
~The way the shiftOut(); function works with the 74HC595 shift register is as follows. shiftOut(dataPin, clockPin, LSBFIRST/MSBFIRST, byteToSend);
-dataPin - Pin on which Information will be sent.
-clockPin - Pin that tells the receiver when a bit is ready to be read.
-LSBFIRST - Tells that the bit starting at 1 then 2, 4, 8 are to be sent in that order.
-MSBFIRST - Same as above but starting at the high end to the low end.
-byteToSend - That is where the bitwise help comes in, That is the Binary representation of the data
~So my example is, imagine I have an led 10000111(top left in the multiplexer) and I need to keep it on but then I need to turn on the 3rd led there are a few ways I could do this, one is I could bitwise OR 10000101 and 00100101, this would make 10100101, but then there are some problems that I'll put in later, because Oh My Glod is this explanation really long...

BareBones:
~Not really a whole thing in itself, I have just been learning some really close to the cpu programming. This led is running so flobbin' fast it's ridiculous. Like honestly 16million calculations per second, the really ridiculous thing is, that some things I have done to improve operation have only shaved nanoseconds off, but have seen major improvement because of such. This brought in a new library which is just a re-write of the already existing main arduino library, but rather than typing out
Code:
digitalWrite(13, HIGH);
digitalWrite(13, LOW);
//I can instead use
GPIO_PORT_REG(pin) &= ~GPIO_PIN_MASK(pin);
GPIO_PORT_REG(pin) |= GPIO_PIN_MASK(pin);
This sounds and looks like I'm doing a funk load more work, but honestly it's not. I won't explain it all, but I will give you some data.
The first set of code(digitalWrite()) takes 6.8microseconds
The second set of code takes 1.4 microseconds!
Thats not a whole lot until you think that just to write the led board it has to cycle through 1024 leds *without you being able to see them turn off* and process the game/input. Infact I will post a video demonstration of the difference. Note: It is one led right now, and represents the difference between the first led and the last led.



Last edited by Gecko on 5/8/2014, 5:25 am; edited 2 times in total
Gecko
Gecko
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Gecko 31/7/2014, 4:55 am

So this is all the physical progress on the table, not a whole heck of a lot, but honestly $226 USD on the electronics... not that I don't have the money, but dropping $500 USD in one weekend is not my ideal start, so after I have gained an untold amount of money is when the table will start being thrown together, probably mid-August so I can use my school's shop class.

Table:


Last edited by Gecko on 1/8/2014, 6:51 pm; edited 1 time in total
Gecko
Gecko
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Inhaps 31/7/2014, 8:50 am

That sounds like a pretty fun project. Looking forward to you going through with it.
Inhaps
Inhaps
Grandmaster (2000 posts)
Grandmaster (2000 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Christmas 31/7/2014, 6:24 pm

This is going to be amazing!! I cant wait to see the progress and how it finally turns out!!
Christmas
Christmas
Grandmaster (2000 posts)
Grandmaster (2000 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Tuff Tiga 31/7/2014, 7:21 pm

Awesome that you're using C Wink So looking forward to this Razz
Tuff Tiga
Tuff Tiga
Grandmaster (2000 posts)
Grandmaster (2000 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Mr Rockeye 31/7/2014, 7:38 pm

- Spills his drink, table is ruined -

Very nice idea really awesome.
Please post a photo when it's finished Very Happy
Mr Rockeye
Mr Rockeye
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Gecko 1/8/2014, 5:16 pm

For Mr Rockeye, this is a full log Razz, so yes, there will be plenty of pictures of the all the steps. Also 'twill be sealed, I have yet to decide a sealant, but I have shellac, and lacquer is fairly cheap, well compared to the rest of the table.

For Inhaps and Xmas, thanks guys, there are a couple features unlisted, but those will be some of the cooler ones.

And Tiga, first use I will actually have of bitwise logic XD. Here is a picture of the source folder, crazy colorful XD, but honestly with my computers awesome stats compiling can take a few seconds, on simple code, so I expect the compiling on this to take a little while, but then thats the point of a stdafx.h XD

Source Folder:

And this is roughly what the table will look like.

Table:
Gecko
Gecko
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by RedRaven 2/8/2014, 4:56 am

This sounds pretty amazing, i am curious to see how this will turn out since i have never heard of anything like this being done before. Smile
RedRaven
RedRaven
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Imperfectpur 5/8/2014, 5:22 pm

Nice man, keep it up, looking forward for future updates!
Imperfectpur
Imperfectpur
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Gecko 6/8/2014, 5:05 am

Hmm... forgot to make a post for this so here are some pictures. Scale of insanity 1 - 100. 9001!
DIP Mounts:
Those are the mounts for the ic's
RGB LED's:
This is the scary part, only 26 of those aren't being used...
Gecko
Gecko
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Gecko 7/8/2014, 5:18 am

Update again, I have decided to etch my own printed circuit boards. Total cost of $170...
Circuit Layout, Top Half on Left:
EDIT: Those were the circuit board, but honestly I need to place the chips somewhere so this became a little, crap load more awesome looking, The backwards names are irl friends who have contributed ideas... I have a rep of being Lank Chank(given a bit rascist, I didn't make the nickname):
NEW Circuit Layout:
Gecko
Gecko
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Gecko 20/8/2014, 2:45 am

UPDATE:
So Funk making my own circuit boards, that is flipping insane, at least on the scale and complexity I need so I'm ordering them for the same price from Seeed.

Should be receiving my first 5 prototypes in the next 15 days. At that point if I make one up and it works correctly I'll be ordering 100 more... The prototypes are red, so I will post a picture.

Wood work is going to start in the near future. Not looking forward to that craziness. As well I will actually be making a full tutorial on this for anyone interested on Instructables, to enter into a tech contest.
Gecko
Gecko
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Gecko 24/8/2014, 6:17 am

It has been 4 days, status of PCB orders changed to processing. Bought new soldering equipment, and a few prototyping resistors and diodes.

EDIT: Status has been changed to shipped. Really quick turn around.
Gecko
Gecko
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Gecko 30/8/2014, 2:41 pm

UPDATE: My prototype circuitboards will arrive today, if they pass my test 100 more will be ordered. I will upload a video of the test when I assemble one.
Gecko
Gecko
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Gecko 5/9/2014, 2:15 pm

Received my second prototypes... they don't work... But I have a new design about to be ordered that should work perfectly(I have tested it)
Gecko
Gecko
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Gecko 17/9/2014, 1:17 pm

Starting actual construction on table in the next few days. Have to work a few more days and get some more money.
Gecko
Gecko
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by kalio 17/9/2014, 7:57 pm

This looks like a really unique project. Can't wait to see how it turns out.
kalio
kalio
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Gecko 9/10/2014, 3:28 pm

Chinese holidays... severely delayed my new circuit boards... so it'll be a few more days before I can even start most of the soldering >.>
Gecko
Gecko
Tier 4 (500 posts)
Tier 4 (500 posts)


Back to top Go down

~ Project BlackBox ~ Empty Re: ~ Project BlackBox ~

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum