Hello!
I am having a problem with my code, it is for a radio-fax program. I store the "pixels" of the letter "G" in a two dimensional char array, and go through it with two for-statements to set the radio-pin High if there is a X and low if there is a O.
But the if-statement doesnt work, i cant compare 'x' to letter_g[row][col], and i dont understand why. Can anyone give me a helper?
void setup()
{
pinMode(2, OUTPUT);
Serial.begin(9600);
}
void loop()
{
char *letter_g[][14] = {{"o","o","o","o","o","o","o","o","o","o","o","o","o","o"},
{"o","o","x","x","x","x","x","x","x","x","x","x","o","o"},
{"o","o","x","x","o","o","o","o","o","o","x","x","o","o"},
{"o","o","x","x","o","o","o","o","o","o","x","x","o","o"},
{"o","o","x","x","o","o","x","x","o","o","x","x","o","o"},
{"o","o","x","x","x","x","x","x","o","o","x","x","o","o"},
{"o","o","o","o","o","o","o","o","o","o","o","o","o","o"}};
for(int row = 0; row < 7;row++)
{
for(int col = 0; col < 14;col++)
{
if(letter_g[row][col] == 'x')
{
digitalWrite(2, HIGH);
delayMicroseconds(4045L);
digitalWrite(2, LOW);
Serial.print("x");
}
else
{
delayMicroseconds(4045L);
Serial.print("o");
}
}
}
}
