2
LiquidCrystal Library - Custom Characters
4
Demonstrates how to add custom characters on an LCD display.
5
The LiquidCrystal library works with all LCD displays that are
6
compatible with the Hitachi HD44780 driver. There are many of
7
them out there, and you can usually tell them by the 16-pin interface.
9
This sketch prints "I <heart> Arduino!" and a little dancing man
13
* LCD RS pin to digital pin 12
14
* LCD Enable pin to digital pin 11
15
* LCD D4 pin to digital pin 5
16
* LCD D5 pin to digital pin 4
17
* LCD D6 pin to digital pin 3
18
* LCD D7 pin to digital pin 2
19
* LCD R/W pin to ground
21
* ends to +5V and ground
22
* wiper to LCD VO pin (pin 3)
23
* 10K poterntiometer on pin A0
27
Based on Adafruit's example at
28
https://github.com/adafruit/SPI_VFD/blob/master/examples/createChar/createChar.pde
30
This example code is in the public domain.
31
http://www.arduino.cc/en/Tutorial/LiquidCrystal
34
http://icontexto.com/charactercreator/
38
// include the library code:
39
#include <LiquidCrystal.h>
41
// initialize the library with the numbers of the interface pins
42
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
44
// make some custom characters:
100
// create a new character
101
lcd.createChar(0, heart);
102
// create a new character
103
lcd.createChar(1, smiley);
104
// create a new character
105
lcd.createChar(2, frownie);
106
// create a new character
107
lcd.createChar(3, armsDown);
108
// create a new character
109
lcd.createChar(4, armsUp);
111
// set up the lcd's number of columns and rows:
113
// Print a message to the lcd.
116
lcd.print(" Arduino! ");
122
// read the potentiometer on A0:
123
int sensorReading = analogRead(A0);
124
// map the result to 200 - 1000:
125
int delayTime = map(sensorReading, 0, 1023, 200, 1000);
126
// set the cursor to the bottom row, 5th position:
128
// draw the little man, arms down: