aboutsummaryrefslogtreecommitdiff
path: root/libraries/LiquidCrystal/examples
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2009-07-25 18:26:29 +0000
committerDavid A. Mellis <d.mellis@arduino.cc>2009-07-25 18:26:29 +0000
commit58b4e52f7f7340f50f56363575dd2b08d71eec0e (patch)
tree93ff67618e28af462666b56c36266fba53111092 /libraries/LiquidCrystal/examples
parentf504460fc47cbd8d0e127e410263558912259f64 (diff)
Updating LiquidCrystal API and examples.
Diffstat (limited to 'libraries/LiquidCrystal/examples')
-rw-r--r--libraries/LiquidCrystal/examples/Blink/Blink.pde8
-rw-r--r--libraries/LiquidCrystal/examples/Cursor/Cursor.pde4
-rw-r--r--libraries/LiquidCrystal/examples/IncrementDecrement/IncrementDecrement.pde21
-rw-r--r--libraries/LiquidCrystal/examples/Shift/Shift.pde8
4 files changed, 21 insertions, 20 deletions
diff --git a/libraries/LiquidCrystal/examples/Blink/Blink.pde b/libraries/LiquidCrystal/examples/Blink/Blink.pde
index f189fd9..16529e1 100644
--- a/libraries/LiquidCrystal/examples/Blink/Blink.pde
+++ b/libraries/LiquidCrystal/examples/Blink/Blink.pde
@@ -45,12 +45,12 @@ void setup() {
}
void loop() {
- // Turn off the display:
+ // Turn off the blinking cursor:
lcd.noBlink();
- delay(500);
- // Turn on the display:
+ delay(3000);
+ // Turn on the blinking cursor:
lcd.blink();
- delay(500);
+ delay(3000);
}
diff --git a/libraries/LiquidCrystal/examples/Cursor/Cursor.pde b/libraries/LiquidCrystal/examples/Cursor/Cursor.pde
index e28c719..dcc27e5 100644
--- a/libraries/LiquidCrystal/examples/Cursor/Cursor.pde
+++ b/libraries/LiquidCrystal/examples/Cursor/Cursor.pde
@@ -45,10 +45,10 @@ void setup() {
}
void loop() {
- // Turn off the display:
+ // Turn off the cursor:
lcd.noCursor();
delay(500);
- // Turn on the display:
+ // Turn on the cursor:
lcd.cursor();
delay(500);
}
diff --git a/libraries/LiquidCrystal/examples/IncrementDecrement/IncrementDecrement.pde b/libraries/LiquidCrystal/examples/IncrementDecrement/IncrementDecrement.pde
index 32ce4dc..33adfc0 100644
--- a/libraries/LiquidCrystal/examples/IncrementDecrement/IncrementDecrement.pde
+++ b/libraries/LiquidCrystal/examples/IncrementDecrement/IncrementDecrement.pde
@@ -1,13 +1,13 @@
/*
- LiquidCrystal Library - Increment/Decrement
+ LiquidCrystal Library - Autoscroll
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.
- This sketch demonstrates the use of the shiftIncrement()
- and shifDecrement() functions.
+ This sketch demonstrates the use of the autoscroll()
+ and noAutoscroll() functions.
The circuit:
* LCD RS pin to digital pin 12
@@ -37,29 +37,30 @@
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
- // set up the LCD's number of rows and columns:
+ // set up the LCD's number of columns and rows:
lcd.begin(2, 16);
}
void loop() {
- // set the cursor to (0,0):
+ // set the cursor to (0,0):
lcd.setCursor(0, 0);
- // set the display to left justify:
- lcd.shiftDecrement();
// print from 0 to 9:
for (int thisChar = 0; thisChar < 10; thisChar++) {
lcd.print(thisChar);
delay(500);
}
- // set the cursor to (16,0):
+
+ // set the cursor to (16,1):
lcd.setCursor(16,1);
- // set the display to left justify:
- lcd.shiftIncrement();
+ // set the display to automatically scroll:
+ lcd.autoscroll();
// print from 0 to 9:
for (int thisChar = 0; thisChar < 10; thisChar++) {
lcd.print(thisChar);
delay(500);
}
+ // turn off automatic scrolling
+ lcd.noAutoscroll();
// clear screen for the next loop:
lcd.clear();
diff --git a/libraries/LiquidCrystal/examples/Shift/Shift.pde b/libraries/LiquidCrystal/examples/Shift/Shift.pde
index 0326c51..3e88020 100644
--- a/libraries/LiquidCrystal/examples/Shift/Shift.pde
+++ b/libraries/LiquidCrystal/examples/Shift/Shift.pde
@@ -1,12 +1,12 @@
/*
- LiquidCrystal Library - Shift
+ LiquidCrystal Library - TextDirection
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.
- This sketch demonstrates how to use shiftLeft() and shiftRight()
+ This sketch demonstrates how to use leftToRight() and rightToLeft()
to move the cursor.
The circuit:
@@ -51,12 +51,12 @@ void loop() {
// reverse directions at 'm':
if (thisChar == 'm') {
// go right for the next letter
- lcd.shiftRight();
+ lcd.rightToLeft();
}
// reverse again at 's':
if (thisChar == 's') {
// go left for the next letter
- lcd.shiftLeft();
+ lcd.leftToRight();
}
// reset at 'z':
if (thisChar > 'z') {