Hi everyone,
I have a weird issue with a led matrix 4x4 I did following this tutorial :
http://www.multiwingspan.co.uk/arduino.php?page=matrix
I wanted the led to turn on subsequently following this pattern :
1st column : 1 row -> 2nd row -> 3rd row -> 4th row
2nd column : 1st row etc...
3rd column : 1st row etc ..
4th column : 1st row -> 2nd row -> 3rd row -> 4th row
It worked perfectly fine with blue leds and then I wanted to try with OSRAM opto led sfh 4557, it goes this way :
All columns 1st rows
All columns 2nd rows
All columns 3rd rows
All columns 4th rows
If you have any ideas of what is happening,n it would help me a lot.
Just FYI, I did test, when I replace only one blue led by an IR led, the column where the led is, is turning on each time subsequently following the row pattern.
Thanks a lot for your help.
// anodes
int row[] = {4,5,6,7};
// cathodes
int col[] = {8,9,10,11};
// bit patterns for each row
byte data[] = {
0,0,0,0};
// defines the size of the matrix
int columns = 4;
int rows = 4;
int xcol = 0;
int xrow = 0;
//millisecond delay between displaying each row
int pause = 1100;
void setup()
{
Serial.begin(9600);
for (int i=0;i<4;i++)
{
pinMode(row*, OUTPUT);*
_ pinMode(col*, OUTPUT);_
_ } _
_ allOff();_
_}_
void loop()
_{ _
_ showPattern();_
_}_
void allOff()
_{_
_ for (int i=0;i<4;i++)_
_ {_
_ digitalWrite(row, LOW);
digitalWrite(col, HIGH);
}
}
void showPattern()
{
allOff();
for (int thisrow=0;thisrow<16;thisrow++)
{
xrow=((thisrow) % 4);
xcol=((thisrow) / 4);
digitalWrite(row[xrow], HIGH);
digitalWrite(col[xcol], LOW);
delay(pause);
allOff();
}
}*_