Skip to content

Instantly share code, notes, and snippets.

@roolo
Created June 4, 2017 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roolo/1294017d6e086ccef4701f334fadf6f1 to your computer and use it in GitHub Desktop.
Save roolo/1294017d6e086ccef4701f334fadf6f1 to your computer and use it in GitHub Desktop.
#include <LiquidCrystal.h>
String lcdLine = "";
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
//lcd.print("hello, world!");
// start serial port at 9600 bps:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
}
void loop() {
lcdLine = "";
lcdLine = Serial.readStringUntil("\n");
if (lcdLine.length() > 0) {
lcd.setCursor(0, 0);
lcdLine.trim();
lcd.print(lcdLine);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment