LED cube 3x3x3

I hope this goes to a place w/ someone who can assist me.

I built my cube wrote my code.  My C skills are very limited and something like this would strengthen it I imagine.  I would like some help in creating the letters though, kinda like they did in the blue 8x8x8 demo with the INSTRUCTABLE.  So far I cannot make all the LED's light up in a single column, and make another column light up only one or two simultaneously.  I'm lighting the whole thing.  I understand the multiplexing and the lights in each column are toggling faster than I can see, but I still would like an idea.  I'm going to do an 8x8x8 for capstone and would like to get familiar with this one first.  Using the arduino uno and software.  Any tips would be appreciated.


sort by: active | newest | oldest
caitlinsdad5 years ago
link to which instructable you are trying to make, please

was your code based on an existing sketch that you modified and did it run correctly with another sample sketch? which schematic did you follow and how is it pinned to the arduino?
jacco82 (author)  caitlinsdad5 years ago
its multiplexed i believe. columns are tied to pwm pins 2-10 and the levels are tied to three NPN's and dig pins 11-13.

234 11 top row
567 12
8910 13

I used the embedded fade sketch and deleted what was there and started my own to start with.

Heres what I have for now.


This example shows how to fade an LED on pin 9
using the analogWrite() function.

This example code is in the public domain.

int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by

void setup() {
// declare pin 9 to be an output:
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);

void loop() {
// set the brightness of pin 9:
analogWrite(6, brightness);
digitalWrite(11, HIGH);
digitalWrite(12, HIGH);
digitalWrite(13, HIGH);
analogWrite(2, brightness);
analogWrite(2, LOW);
analogWrite(3, brightness);
analogWrite(3, LOW);
analogWrite(4, brightness);
analogWrite(4, LOW);
analogWrite(7, brightness);
analogWrite(7, LOW);
analogWrite(10, brightness);
analogWrite(10, LOW);
analogWrite(9, brightness);
analogWrite(9, LOW);
analogWrite(8, brightness);
analogWrite(8, LOW);
analogWrite(5, brightness);
analogWrite(5, LOW);

// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;

// reverse the direction of the fading at the ends of the fade:
if (brightness == 0 || brightness == 255) {
fadeAmount = -fadeAmount ;
// wait for 30 milliseconds to see the dimming effect

I did this in a few minutes and It works fine other than a glitch, which I'm not sure what caused it. I have a C book but not sure where to look right now.
I've seen in other led matrices, if you are using white/clear LEDs, there is current leakage and that does weird things to the lights. You would need to put diodes in the with the resistors to control the flow of electricity in the grid.
jacco82 (author)  caitlinsdad5 years ago
The cube really works and is fully functional except for the little glitch. Unless you don't observe an actual problem in the code than I can give it a try. For the first question though, would you have an idea with the programming to make the letters. If I can get one letter to work I can get all letters to work. Its just a matter of progression.

then again, I might be misunderstanding this all. have a look at this 3x3 cube ible and follow link to his code.