From 5101d36d8440db7ea6930b0bf29b253f552c4026 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Sat, 25 Jul 2009 18:28:35 +0000 Subject: Renaming LiquidCrystal example directories to correspond to new function names. --- .../LiquidCrystal/examples/TextDirection/Shift.pde | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 libraries/LiquidCrystal/examples/TextDirection/Shift.pde (limited to 'libraries/LiquidCrystal/examples/TextDirection') diff --git a/libraries/LiquidCrystal/examples/TextDirection/Shift.pde b/libraries/LiquidCrystal/examples/TextDirection/Shift.pde new file mode 100644 index 0000000..3e88020 --- /dev/null +++ b/libraries/LiquidCrystal/examples/TextDirection/Shift.pde @@ -0,0 +1,82 @@ + /* + 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 leftToRight() and rightToLeft() + to move the cursor. + + The circuit: + * LCD RS pin to digital pin 12 + * LCD Enable pin to digital pin 11 + * LCD D4 pin to digital pin 5 + * LCD D5 pin to digital pin 4 + * LCD D6 pin to digital pin 3 + * LCD D7 pin to digital pin 2 + * 10K resistor: + * ends to +5V and ground + * wiper to LCD VO pin (pin 3) + + Library originally added 18 Apr 2008 + by David A. Mellis + library modified 5 Jul 2009 + by Limor Fried (http://www.ladyada.net) + example added 9 Jul 2009 + by Tom Igoe + + http://www.arduino.cc/en/Tutorial/LiquidCrystal + + */ + +// include the library code: +#include + +// initialize the library with the numbers of the interface pins +LiquidCrystal lcd(12, 11, 5, 4, 3, 2); + +int thisChar = 'a'; + +void setup() { + // set up the LCD's number of rows and columns: + lcd.begin(2, 16); + // turn on the cursor: + lcd.cursor(); + Serial.begin(9600); +} + +void loop() { + // reverse directions at 'm': + if (thisChar == 'm') { + // go right for the next letter + lcd.rightToLeft(); + } + // reverse again at 's': + if (thisChar == 's') { + // go left for the next letter + lcd.leftToRight(); + } + // reset at 'z': + if (thisChar > 'z') { + // go to (0,0): + lcd.home(); + // start again at 0 + thisChar = 'a'; + } + // print the character + lcd.print(thisChar, BYTE); + // wait a second: + delay(1000); + // increment the letter: + thisChar++; +} + + + + + + + + -- cgit v1.2.3-18-g5258 From 79c0ffdcdb4f01629f6d8a6a78cd8a76dd4c7592 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Sat, 25 Jul 2009 18:29:53 +0000 Subject: Renaming LiquidCrystal example .pde files to correspond to new function names. --- .../LiquidCrystal/examples/TextDirection/Shift.pde | 82 ---------------------- .../examples/TextDirection/TextDirection.pde | 82 ++++++++++++++++++++++ 2 files changed, 82 insertions(+), 82 deletions(-) delete mode 100644 libraries/LiquidCrystal/examples/TextDirection/Shift.pde create mode 100644 libraries/LiquidCrystal/examples/TextDirection/TextDirection.pde (limited to 'libraries/LiquidCrystal/examples/TextDirection') diff --git a/libraries/LiquidCrystal/examples/TextDirection/Shift.pde b/libraries/LiquidCrystal/examples/TextDirection/Shift.pde deleted file mode 100644 index 3e88020..0000000 --- a/libraries/LiquidCrystal/examples/TextDirection/Shift.pde +++ /dev/null @@ -1,82 +0,0 @@ - /* - 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 leftToRight() and rightToLeft() - to move the cursor. - - The circuit: - * LCD RS pin to digital pin 12 - * LCD Enable pin to digital pin 11 - * LCD D4 pin to digital pin 5 - * LCD D5 pin to digital pin 4 - * LCD D6 pin to digital pin 3 - * LCD D7 pin to digital pin 2 - * 10K resistor: - * ends to +5V and ground - * wiper to LCD VO pin (pin 3) - - Library originally added 18 Apr 2008 - by David A. Mellis - library modified 5 Jul 2009 - by Limor Fried (http://www.ladyada.net) - example added 9 Jul 2009 - by Tom Igoe - - http://www.arduino.cc/en/Tutorial/LiquidCrystal - - */ - -// include the library code: -#include - -// initialize the library with the numbers of the interface pins -LiquidCrystal lcd(12, 11, 5, 4, 3, 2); - -int thisChar = 'a'; - -void setup() { - // set up the LCD's number of rows and columns: - lcd.begin(2, 16); - // turn on the cursor: - lcd.cursor(); - Serial.begin(9600); -} - -void loop() { - // reverse directions at 'm': - if (thisChar == 'm') { - // go right for the next letter - lcd.rightToLeft(); - } - // reverse again at 's': - if (thisChar == 's') { - // go left for the next letter - lcd.leftToRight(); - } - // reset at 'z': - if (thisChar > 'z') { - // go to (0,0): - lcd.home(); - // start again at 0 - thisChar = 'a'; - } - // print the character - lcd.print(thisChar, BYTE); - // wait a second: - delay(1000); - // increment the letter: - thisChar++; -} - - - - - - - - diff --git a/libraries/LiquidCrystal/examples/TextDirection/TextDirection.pde b/libraries/LiquidCrystal/examples/TextDirection/TextDirection.pde new file mode 100644 index 0000000..3e88020 --- /dev/null +++ b/libraries/LiquidCrystal/examples/TextDirection/TextDirection.pde @@ -0,0 +1,82 @@ + /* + 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 leftToRight() and rightToLeft() + to move the cursor. + + The circuit: + * LCD RS pin to digital pin 12 + * LCD Enable pin to digital pin 11 + * LCD D4 pin to digital pin 5 + * LCD D5 pin to digital pin 4 + * LCD D6 pin to digital pin 3 + * LCD D7 pin to digital pin 2 + * 10K resistor: + * ends to +5V and ground + * wiper to LCD VO pin (pin 3) + + Library originally added 18 Apr 2008 + by David A. Mellis + library modified 5 Jul 2009 + by Limor Fried (http://www.ladyada.net) + example added 9 Jul 2009 + by Tom Igoe + + http://www.arduino.cc/en/Tutorial/LiquidCrystal + + */ + +// include the library code: +#include + +// initialize the library with the numbers of the interface pins +LiquidCrystal lcd(12, 11, 5, 4, 3, 2); + +int thisChar = 'a'; + +void setup() { + // set up the LCD's number of rows and columns: + lcd.begin(2, 16); + // turn on the cursor: + lcd.cursor(); + Serial.begin(9600); +} + +void loop() { + // reverse directions at 'm': + if (thisChar == 'm') { + // go right for the next letter + lcd.rightToLeft(); + } + // reverse again at 's': + if (thisChar == 's') { + // go left for the next letter + lcd.leftToRight(); + } + // reset at 'z': + if (thisChar > 'z') { + // go to (0,0): + lcd.home(); + // start again at 0 + thisChar = 'a'; + } + // print the character + lcd.print(thisChar, BYTE); + // wait a second: + delay(1000); + // increment the letter: + thisChar++; +} + + + + + + + + -- cgit v1.2.3-18-g5258 From 739714e28c289c3e124baab6fbe33e82588deddb Mon Sep 17 00:00:00 2001 From: Tom Igoe Date: Sun, 2 Aug 2009 18:45:13 +0000 Subject: Changed begin() in LiquidCrystal examples --- libraries/LiquidCrystal/examples/TextDirection/TextDirection.pde | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libraries/LiquidCrystal/examples/TextDirection') diff --git a/libraries/LiquidCrystal/examples/TextDirection/TextDirection.pde b/libraries/LiquidCrystal/examples/TextDirection/TextDirection.pde index 3e88020..196c5cf 100644 --- a/libraries/LiquidCrystal/examples/TextDirection/TextDirection.pde +++ b/libraries/LiquidCrystal/examples/TextDirection/TextDirection.pde @@ -41,7 +41,7 @@ int thisChar = 'a'; void setup() { // set up the LCD's number of rows and columns: - lcd.begin(2, 16); + lcd.begin(16, 2); // turn on the cursor: lcd.cursor(); Serial.begin(9600); -- cgit v1.2.3-18-g5258 From fd3bcef9d52e57626306391156f6cad0e31cee82 Mon Sep 17 00:00:00 2001 From: Tom Igoe Date: Wed, 5 Aug 2009 14:40:55 +0000 Subject: Checked and updated all LiquidCrystal examples --- libraries/LiquidCrystal/examples/TextDirection/TextDirection.pde | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libraries/LiquidCrystal/examples/TextDirection') diff --git a/libraries/LiquidCrystal/examples/TextDirection/TextDirection.pde b/libraries/LiquidCrystal/examples/TextDirection/TextDirection.pde index 196c5cf..725eb0d 100644 --- a/libraries/LiquidCrystal/examples/TextDirection/TextDirection.pde +++ b/libraries/LiquidCrystal/examples/TextDirection/TextDirection.pde @@ -26,6 +26,8 @@ by Limor Fried (http://www.ladyada.net) example added 9 Jul 2009 by Tom Igoe + modified 25 July 2009 + by David A. Mellis http://www.arduino.cc/en/Tutorial/LiquidCrystal -- cgit v1.2.3-18-g5258