Created
June 4, 2017 14:23
-
-
Save roolo/1294017d6e086ccef4701f334fadf6f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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