Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include <SoftwareSerial.h>
SoftwareSerial mySerial(9, 10); //RX,TX
String tmp;
void setup() {
Serial.begin(9600);
mySerial.begin(9600);
};
void loop() {
while (mySerial.available() > 0) {
tmp += char(mySerial.read());
delay(2);
}
if(tmp.length() > 0) {
Serial.println(tmp);
tmp = "";
}
if (Serial.available()) {
mySerial.write(Serial.read());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment