Last active
October 3, 2019 07:49
-
-
Save neosarchizo/f6dcd476334e75aae54f1219c01521e3 to your computer and use it in GitHub Desktop.
[디바이스마트] USB to UART TTL 테스트 코드
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
void setup() { | |
Serial1.begin(9600); | |
} | |
void loop() { | |
Serial1.println("Hello world"); | |
if(Serial1.available()){ | |
Serial1.print("Reply) "); | |
while(Serial1.available()){ | |
Serial1.write(Serial1.read()); | |
} | |
Serial1.println(); | |
} | |
delay(1000); | |
} |
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 <SoftwareSerial.h> | |
SoftwareSerial mySerial(2,3); | |
void setup() { | |
mySerial.begin(9600); | |
} | |
void loop() { | |
mySerial.println("Hello world"); | |
if(mySerial.available()){ | |
mySerial.print("Reply) "); | |
while(mySerial.available()){ | |
mySerial.write(mySerial.read()); | |
} | |
mySerial.println(); | |
} | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment