Skip to content

Instantly share code, notes, and snippets.

@benphelps
Created August 18, 2014 00:29
Show Gist options
  • Save benphelps/fc023c82c72fd1e5d033 to your computer and use it in GitHub Desktop.
Save benphelps/fc023c82c72fd1e5d033 to your computer and use it in GitHub Desktop.
#include <serLCD.h>
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11);
serLCD lcd(11);
int tmp;
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
lcd.clear();
lcd.home();
}
void loop()
{
if (Serial.available()) {
tmp = Serial.read();
switch(tmp) {
case 0x11:
lcd.clear();
break;
case 0x12:
lcd.home();
break;
case 0x13:
lcd.selectLine(1);
break;
case 0x14:
lcd.selectLine(2);
break;
default:
lcd.write(tmp);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment