Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 21 | jlesech | 1 | /* |
| 2 | * |
||
| 3 | * copyleft 2011 snootlab |
||
| 4 | * free software, have fun ! |
||
| 5 | * |
||
| 6 | based on official arduino LiquidCrystal Library |
||
| 7 | - display() and noDisplay() |
||
| 8 | |||
| 9 | Demonstrates the use a 16x2 LCD display. The LiquidCrystal |
||
| 10 | library works with all LCD displays that are compatible with the |
||
| 11 | Hitachi HD44780 driver. There are many of them out there, and you |
||
| 12 | can usually tell them by the 16-pin interface. |
||
| 13 | |||
| 14 | This sketch prints "Hello World!" to the LCD and uses the |
||
| 15 | display() and noDisplay() functions to turn on and off |
||
| 16 | the display. |
||
| 17 | |||
| 18 | The circuit: |
||
| 19 | * LCD RS pin to digital pin 12 |
||
| 20 | * LCD Enable pin to digital pin 11 |
||
| 21 | * LCD D4 pin to digital pin 5 |
||
| 22 | * LCD D5 pin to digital pin 4 |
||
| 23 | * LCD D6 pin to digital pin 3 |
||
| 24 | * LCD D7 pin to digital pin 2 |
||
| 25 | * LCD R/W pin to ground |
||
| 26 | * 10K resistor: |
||
| 27 | * ends to +5V and ground |
||
| 28 | * wiper to LCD VO pin (pin 3) |
||
| 29 | |||
| 30 | Library originally added 18 Apr 2008 |
||
| 31 | by David A. Mellis |
||
| 32 | library modified 5 Jul 2009 |
||
| 33 | by Limor Fried (http://www.ladyada.net) |
||
| 34 | example added 9 Jul 2009 |
||
| 35 | by Tom Igoe |
||
| 36 | modified 22 Nov 2010 |
||
| 37 | by Tom Igoe |
||
| 38 | |||
| 39 | This example code is in the public domain. |
||
| 40 | |||
| 41 | http://www.arduino.cc/en/Tutorial/LiquidCrystal |
||
| 42 | */ |
||
| 43 | |||
| 44 | // include the library code: |
||
| 45 | #include "Wire.h" |
||
| 46 | #include <Deuligne.h> |
||
| 47 | |||
| 48 | // initialize the library with the numbers of the interface pins |
||
| 49 | Deuligne lcd; |
||
| 50 | |||
| 51 | void setup() { |
||
| 52 | // set up the LCD's number of columns and rows: |
||
| 53 | lcd.init(); |
||
| 54 | // Print a message to the LCD. |
||
| 55 | lcd.print("hello, world!"); |
||
| 56 | } |
||
| 57 | |||
| 58 | void loop() { |
||
| 59 | // Turn off the display: |
||
| 60 | lcd.noDisplay(); |
||
| 61 | delay(500); |
||
| 62 | // Turn on the display: |
||
| 63 | lcd.display(); |
||
| 64 | delay(500); |
||
| 65 | } |
||
| 66 |