User manual
reflect our 5 x 8 dots in the LCD. Where we set a 1 in the binary
code, a white dot will appear later. With
lcd.write(byte(0))
, we
write the character onto the LCD.
The example makes the entire thing even clearer. Try to produce
a battery symbol or a thermometer.
The experiment requires the LCD basic writing that you set up
in the function test.
001 // Integrating LCD-Library
002 #include <LiquidCrystal.h>
003
004 // Specifying LCD pins
005 // RS, E, D4, D5, D6, D7
006 LiquidCrystal lcd(11, 10, 2, 3, 4, 5);
007
008 byte myChar[8] = {
009 B00000,
010 B10001,
011 B00000,
012 B00000,
013 B10001,
014 B01110,
015 B00000,
016 };
017
018 void setup()
019 {
020 // LED-Backlighting
021 analogWrite(9, 150);
022
023 lcd.createChar(0, myChar);
024 lcd.begin(16, 2);
025 lcd.write(byte(0));
026 }
027
028 void loop()
029 {
030
031 // Nothing to do...
032
033 }