Skip to content

Instantly share code, notes, and snippets.

@volca
Created May 24, 2013 01:08
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 volca/5640680 to your computer and use it in GitHub Desktop.
Save volca/5640680 to your computer and use it in GitHub Desktop.
#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