Last active
July 9, 2019 06:41
-
-
Save surinoel/7bbafd6f75d8fa4eec6ee0871e995cd4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
LiquidCrystal lcd(13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3); | |
int row1Flag = 0; | |
void setup() { | |
// put your setup code here, to run once: | |
lcd.begin(16, 2); | |
lcd.print("Hello!!"); | |
lcd.setCursor(0, 1); | |
lcd.print("EdgeILAB"); | |
Serial.begin(115200); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
String buffer = ""; | |
if(Serial.available() > 0) { | |
buffer = Serial.readString(); | |
} | |
// 두 줄에 걸쳐서 출력 | |
if(buffer != "") { | |
if(row1Flag == 0) { | |
lcd.clear(); | |
lcd.print(buffer); | |
lcd.setCursor(0, 1); | |
row1Flag = 1; | |
} | |
else { | |
lcd.print(buffer); | |
row1Flag = 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment