I have made a Led cube got it working i have programed it but i wanna move to the next step of saving the image of each pattern as a byte array.....
i couldn't use byte because it only accepts 8 values and i have 9 leds.. I wrote the arrays as ints instead but when i upload it nothing happens to the cube..(power shows on mega just the cube doesnt work).
If there is a way to still do it with bytes that may help if it has any advantages working with bytes..
i tried to write some code but nothing happens here it is...
int levelPins[] = {22,23,24};
int colPins[] = {30,31,32,33,34,35,36,37,38};
int first[3][9] = {
111000000,
011100000,
001110000,
};
void setup () {
//set all output
for (int i=0; i<3; i++) {
pinMode(levelPins[i], OUTPUT);
}
for (int j=0; j<9; j++) {
pinMode(colPins[j], OUTPUT);
}
}
void show (int image[3][9]) {
for (int level=0; level<3; level++) {
digitalWrite(levelPins[level], LOW);
for (int col=0; col < 9; col++) {
int pixel = image[level][col];
if (pixel == 1) {digitalWrite(colPins[col], HIGH);}
delay(30);
digitalWrite(colPins[col], LOW);
} // col for
digitalWrite(levelPins[level], HIGH);
} // level for
} // end of show
void loop() {
show(first);
}
Here is a video of the working led cube without images saved as arrays.. that code is somewhere in ...http://arduino.cc/forum/index.php/topic,69174.0.html
Led cube setup - YouTube