Mercurial > code > home > repos > homeauto
view service/busyboxArduino/LiquidCrystal_V1.2.1/LiquidCrystal/examples/SerialDisplay/SerialDisplay.pde @ 961:be320b224bda
liquidcrystal lib
Ignore-this: 3279089c07727731ac8f51edd1bf9cc
darcs-hash:20150120020227-312f9-1c34ff11ded2677bec7a1cf29a71ac70d5ae6e0d
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Mon, 19 Jan 2015 18:02:27 -0800 |
parents | |
children |
line wrap: on
line source
/* * Displays text sent over the serial port (e.g. from the Serial Monitor) on * an attached LCD. */ #include <Wire.h> #include <LiquidCrystal_I2C.h> #define BACKLIGHT_PIN 13 LiquidCrystal_I2C lcd(0x38); // set the LCD address to 0x38 void setup() { pinMode ( BACKLIGHT_PIN, OUTPUT ); lcd.begin (16,2); digitalWrite ( BACKLIGHT_PIN, HIGH ); Serial.begin(57600); } 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()); } } }