How to display variable char on Arduino's LCD?

4

I was trying to print a char variable on the arduino's LCD but I can not, always from the error when I try to compile the code. I have already pulled the LCD library and the line I am trying to print is the following:

lcd.print("%c",letra);

What am I doing wrong? I thank you in advance!

    
asked by anonymous 08.05.2015 / 16:44

1 answer

2

One thing that is important to know about LCD displays is that they have an internal memory. The Arduino simply activates the read or write mode and sends a memory address with the character you want to print through the bus. The following figure shows the available characters:

If you want to print a different character , there is another memory where you send an array of bytes containing the active and inactive pixels that will form your new character. As in the figure below:

Asforyourproblem,Ithinkthefollowinglinesofcodecansolve:

//charvariavel='a';//lcd.print(char(variavel);//Istodeveriafuncionar//lcd.print((char)223);//Istotambémcharcaractere='b';lcd.print(caractere,BIN);//ou...intcharcode=65;lcd.print(charcode);

SincetheLCDreceivesabinarydata,youmustenterthisinformationthroughthe"BIN". So the Arduino will send the binary value corresponding to the character through the bus.

    
08.05.2015 / 19:03