aboutsummaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2008-09-07 12:21:07 +0000
committerDavid A. Mellis <d.mellis@arduino.cc>2008-09-07 12:21:07 +0000
commitf9354a2b9e3c9380091e41e9ad2543633cb83311 (patch)
treefe003c4a56df5afdb8a2614169ebb16cbdbc0653 /libraries
parentb7cd4c1724dc22ca0696068ce951b12037059ccc (diff)
Commented LCD examples.
Diffstat (limited to 'libraries')
-rw-r--r--libraries/LiquidCrystal/examples/HelloWorld/HelloWorld.pde6
-rw-r--r--libraries/LiquidCrystal/examples/SerialDisplay/SerialDisplay.pde15
2 files changed, 21 insertions, 0 deletions
diff --git a/libraries/LiquidCrystal/examples/HelloWorld/HelloWorld.pde b/libraries/LiquidCrystal/examples/HelloWorld/HelloWorld.pde
index f755d9c..438063f 100644
--- a/libraries/LiquidCrystal/examples/HelloWorld/HelloWorld.pde
+++ b/libraries/LiquidCrystal/examples/HelloWorld/HelloWorld.pde
@@ -1,9 +1,15 @@
#include <LiquidCrystal.h>
+// LiquidCrystal display with:
+// rs on pin 12
+// rw on pin 11
+// enable on pin 10
+// d0, d1, d2, d3 on pins 5, 4, 3, 2
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
void setup()
{
+ // Print a message to the LCD.
lcd.print("hello, world!");
}
diff --git a/libraries/LiquidCrystal/examples/SerialDisplay/SerialDisplay.pde b/libraries/LiquidCrystal/examples/SerialDisplay/SerialDisplay.pde
index 6e4336c..940439e 100644
--- a/libraries/LiquidCrystal/examples/SerialDisplay/SerialDisplay.pde
+++ b/libraries/LiquidCrystal/examples/SerialDisplay/SerialDisplay.pde
@@ -1,5 +1,15 @@
+/*
+ * Displays text sent over the serial port (e.g. from the Serial Monitor) on
+ * an attached LCD.
+ */
+
#include <LiquidCrystal.h>
+// LiquidCrystal display with:
+// rs on pin 12
+// rw on pin 11
+// enable on pin 10
+// d0, d1, d2, d3 on pins 5, 4, 3, 2
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
void setup()
@@ -9,10 +19,15 @@ void setup()
void loop()
{
+ // when characters arrive over the serial port...
if (Serial.available()) {
+ // wait a bit for the entire message to arrive
delay(100);
+ // clear the screen
lcd.clear();
+ // read all the available characters
while (Serial.available() > 0) {
+ // display each character to the LCD
lcd.write(Serial.read());
}
}