2
LiquidCrystal Library - setCursor
4
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
5
library works with all LCD displays that are compatible with the
6
Hitachi HD44780 driver. There are many of them out there, and you
7
can usually tell them by the 16-pin interface.
9
This sketch prints to all the positions of the LCD using the
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)
24
Library originally added 18 Apr 2008
26
library modified 5 Jul 2009
27
by Limor Fried (http://www.ladyada.net)
28
example added 9 Jul 2009
33
This example code is in the public domain.
35
http://www.arduino.cc/en/Tutorial/LiquidCrystal
38
// include the library code:
39
#include <LiquidCrystal.h>
41
// these constants won't change. But you can change the size of
42
// your LCD using them:
43
const int numRows = 2;
44
const int numCols = 16;
46
// initialize the library with the numbers of the interface pins
47
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
50
// set up the LCD's number of columns and rows:
51
lcd.begin(numCols,numRows);
55
// loop from ASCII 'a' to ASCII 'z':
56
for (int thisLetter = 'a'; thisLetter <= 'z'; thisLetter++) {
57
// loop over the columns:
58
for (int thisCol = 0; thisCol < numRows; thisCol++) {
59
// loop over the rows:
60
for (int thisRow = 0; thisRow < numCols; thisRow++) {
61
// set the cursor position:
62
lcd.setCursor(thisRow,thisCol);
64
lcd.write(thisLetter);