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 | - Serial Input |
||
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 displays text sent over the serial port |
||
15 | (e.g. from the Serial Monitor) on an attached LCD. |
||
16 | |||
17 | Library originally added 18 Apr 2008 |
||
18 | by David A. Mellis |
||
19 | library modified 5 Jul 2009 |
||
20 | by Limor Fried (http://www.ladyada.net) |
||
21 | example added 9 Jul 2009 |
||
22 | by Tom Igoe |
||
23 | modified 22 Nov 2010 |
||
24 | by Tom Igoe |
||
25 | |||
26 | This example code is in the public domain. |
||
27 | |||
28 | http://www.arduino.cc/en/Tutorial/LiquidCrystal |
||
29 | */ |
||
30 | |||
31 | // include the library code: |
||
32 | #include "Wire.h" |
||
33 | #include <Deuligne.h> |
||
34 | |||
35 | |||
36 | // initialize the library with the numbers of the interface pins |
||
37 | Deuligne lcd; |
||
38 | |||
39 | void setup(){ |
||
40 | // set up the LCD's number of columns and rows: |
||
41 | lcd.init(); |
||
42 | // initialize the serial communications: |
||
43 | Serial.begin(9600); |
||
44 | } |
||
45 | |||
46 | void loop() |
||
47 | { |
||
48 | // when characters arrive over the serial port... |
||
49 | if (Serial.available()) { |
||
50 | // wait a bit for the entire message to arrive |
||
51 | delay(100); |
||
52 | // clear the screen |
||
53 | lcd.clear(); |
||
54 | // read all the available characters |
||
55 | while (Serial.available() > 0) { |
||
56 | // display each character to the LCD |
||
57 | lcd.write(Serial.read()); |
||
58 | } |
||
59 | } |
||
60 | } |