Hi there,
it's been a long time since i last programmed an arduino and maybe im forgetting some of the basics but i searched the forum and although i found a lot of related information, none was a direct solution to my problem, maybe some workarounds if theres not a straight simpler solution.
Here is my code:
const unsigned char texto [] PROGMEM = {
B01110000, //0
B10001000,
B10011000,
B10101000,
B11001000,
B10001000,
B01110000,
6};
.
.
.
some other stuff
.
.
.
if(val=='0'){ //ZERO
lc1.setRow(0,0,texto[0]);
lc1.setRow(0,1,texto[1]);
lc1.setRow(0,2,texto[2]);
lc1.setRow(0,3,texto[3]);
lc1.setRow(0,4,texto[4]);
lc1.setRow(0,5,texto[5]);
lc1.setRow(0,6,texto[6]);
lc1.setRow(0,7,B00000000);
Serial.println("ZERO");
}
if(val=='1'){ //UNO
for (int a=0;a<7;a++){
val = texto[a];
lc1.setRow(0,a,texto[a]);
delay(20);
Serial.println(val,BIN);
}
}
Thing is:
lc1.setRow(0,6,texto[6]); - works as expected, passing B01110000 as a parameter to the setRow func.
lc1.setRow(0,a,texto[a]); - (where a goes from 0 to 6) does not work because it is not binary formated it passes 112 decimal value 64+32+16.
i find this odd, am i missing something here? Whats the most simple way to get it in the B........format?
I thought that having texto[0] would be the same that texto[a] where a=0...can someone explain me the diference? whats makes one work and not the other?
Tanks in advance,
Paulo M.