Add uOLED-96-G1 C Sample Code.
[frickel.git] / projects / geeknamensschilder_c / hardware / libraries / LiquidCrystal / examples / SerialDisplay / SerialDisplay.pde
bloba094c245751fd19da2ebe31e73836d5cb3c5ea7d
1 /*
2   LiquidCrystal Library - Serial Input
3  
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.
8  
9  This sketch displays text sent over the serial port 
10  (e.g. from the Serial Monitor) on an attached LCD.
12  The circuit:
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  * 10K resistor:
20  * ends to +5V and ground
21  * wiper to LCD VO pin (pin 3)
23  Library originally added 18 Apr 2008
24  by David A. Mellis
25  library modified 5 Jul 2009
26  by Limor Fried (http://www.ladyada.net)
27  example added 9 Jul 2009
28  by Tom Igoe 
29 modified 25 July 2009
30  by David A. Mellis
32  http://www.arduino.cc/en/Tutorial/LiquidCrystal
33  */
35 // include the library code:
36 #include <LiquidCrystal.h>
38 // initialize the library with the numbers of the interface pins
39 LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
41 void setup(){
42     // set up the LCD's number of rows and columns: 
43   lcd.begin(16, 2);
44   // initialize the serial communications:
45   Serial.begin(9600);
48 void loop()
50   // when characters arrive over the serial port...
51   if (Serial.available()) {
52     // wait a bit for the entire message to arrive
53     delay(100);
54     // clear the screen
55     lcd.clear();
56     // read all the available characters
57     while (Serial.available() > 0) {
58       // display each character to the LCD
59       lcd.write(Serial.read());
60     }
61   }