How to get charcters on the screen
I am trying to get smiley faces and other symbols to appear on the screen but I have had no luck. I have tried a couple of different codes not I am having no luck. I am using a older version of the UNO board.
Re: How to get charcters on the screen
Example sketch from:
http://tronixstuff.com/2011/01/08/tutor ... rome-lcds/
It defines three custom characters, each of which are made up of seven rows of five pixels.
You can change which pixel turns on and off by altering the byte variables. 1 is on, 0 is off.
http://tronixstuff.com/2011/01/08/tutor ... rome-lcds/
It defines three custom characters, each of which are made up of seven rows of five pixels.
You can change which pixel turns on and off by altering the byte variables. 1 is on, 0 is off.
Code: Select all
// Example 24.2
#include <LiquidCrystal.h> // we need this library for the LCD commands
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(4,5,6,7,8,9); // define our LCD and which pins to use
int d = 3000; // used for display delay
byte a[8] = {
B00000, B00000, B00000, B00100, B00100, B00000, B00000, B00000};
byte b[8] = {
B00000, B00000, B10001, B10001, B10001, B10001, B00000, B00000};
byte c[8] = {
B11111, B10001, B10001, B10001, B10001, B10001, B10001, B11111};
void setup()
{
lcd.createChar(0,a); // define our characters into the sketch as variables
lcd.createChar(1,b);
lcd.createChar(2,c);
lcd.begin(16, 2); // need to specify how many columns and rows are in the LCD unit
lcd.clear(); // this clears the LCD. You can use this at any time
}
void loop()
{
for (int z=0; z<16; z++)
{
lcd.setCursor(z,0);
lcd.write(0); // write the first character
delay(250);
lcd.setCursor(z,0);
lcd.write(1); // write the second character
delay(250);
lcd.setCursor(z,0);
lcd.write(2); // write the third character
delay(250);
lcd.setCursor(z,0);
lcd.write(1); // write the second character
delay(250);
lcd.setCursor(z,0);
lcd.write(0); // write the first character
delay(250);
}
delay(1000);
lcd.clear();
}
Re: How to get charcters on the screen
Thanks for your help.