Hello.
I have been working on building a POV Display using an Arduino Uno. I use Windows 7 and Arduino IDE version 1.0.1. The problem I have been having is that the Arduino outputs byte stream totally different from what I am expecting it to. For example in the code below, I want it to display the byte stream stored in the variable 'comma'.
int pins[] = {2,3,4,5,6,7,8,9}; // an array of pin numbers
int rows= 8; // Total LED's in a row
byte comma[]={00000000,00000000,00000000,00000101,00000110,00000000,00000000,00000000};
// customizable parameters
int timer1 = 5000; // time between columns
int timer2 = 15; // time between frames
int timer3 = 0; // time between drawings
int frame_len = 8; // frame length
void setup()
{
int i;
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
for (i = 0; i < rows; i++)
pinMode(pins[i], OUTPUT); // set each pin as an output
Serial.begin(19200);
}
void loop()
{
digitalWrite(10, OUTPUT);
digitalWrite(11, OUTPUT);
show(comma);
}
void show( byte* image )
{
int a,b,c;
// go through all data for all columns in each frame.
for (b = 0; b < frame_len; b++)
{
for (c = 0; c < rows; c++)
{
Serial.println(image[c], BIN);
}
delay(timer1);
}
}
However the data that was output was weird so I sent it to the serial monitor to check what it was actually outputting. This is what I keep getting,
0
0
0
1000001
1001000
0
0
0
instead of,
0
0
0
00000101
00000110
0
0
0
I simply do not understand what the problem is. Is there something wrong with the code? Am I using the data array incorrectly? What is it?