Skip to content

Instantly share code, notes, and snippets.

@neosarchizo
Last active October 3, 2019 07:49
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 neosarchizo/f6dcd476334e75aae54f1219c01521e3 to your computer and use it in GitHub Desktop.
Save neosarchizo/f6dcd476334e75aae54f1219c01521e3 to your computer and use it in GitHub Desktop.
[디바이스마트] USB to UART TTL 테스트 코드
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);
}
#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