I have been interested in making one of these for a while and found RadioShack had a kit to start from! (I really need to stay away from that place at lunch!) So, I purchased a kit and it sat on my workbench for a few weeks.. Until this weekend when I found time to start working on it. = The Build = It wasn't easy! I made a few mistakes early on with bending the LED legs wrong. I later figured out that as long as your Positve and Negative leads were heading in the right directions, the only thing that mattered was that they were all the same. The most difficult part of the project was lining up the layers and soldering them together. The second most difficult part was putting all the LED's into each of the 3 layers! When I was all done, I had something that looked a little bit like the leaning tower of pisa. I ran the sample code for the cube and found that a few lights were not working on one end. I tinkered with it for a while and figured out a few connections on the bottom of the board were hitting the metal ground on the USB port of the UNO. The sample code can be downloaded from the link in the Radioshack user guide for the cube. They drive the LED's by creating "Pages" of data. The page describes what lights are enabled on each layer, and the time/Intensity in HEX in a format like {layer1,layer2,layer3,ttiii}. I started trying to figure out one layer at a time. I figured out to get the first corner light, I needed to put 0x001 in the box. I started thinking "Maybe they are using BitOps to define each layer". ( don't know what a BitOp is? Read my tutorial on BitOps in the navaigation on the left) So, I tried 0x002 and sure enough, the second light came on! I tried 0x004 and same thing. End light came on. I was able to define the first layer beginning like this:
I assumed from this that the pattern would be:
When I got to the 5th light, something happened. I started getting weird things happening. It suddenly made sense. It needs to be given the code in HEX. So, the pattern is correct, but after you figure out the number, you need to convert from DEC to HEX. If you want to light a single LED on a layer at a time, the table would look like this:
Fun little project for $19, but 3x3x3 limits how visual you can be. I want to build a much bigger cube now! |