Skip to content

Instantly share code, notes, and snippets.

@Azuxul
Created April 9, 2016 20:25
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 Azuxul/70d165b7dad52363568514da844a12ce to your computer and use it in GitHub Desktop.
Save Azuxul/70d165b7dad52363568514da844a12ce to your computer and use it in GitHub Desktop.
#include <SoftwareSerial.h>
SoftwareSerial Bt(49, 8);
String msg;
void setup() {
Serial.begin(9600);
Bt.begin(9600);
}
void loop() {
while(Bt.available()) {
delay(1);
char c = Bt.read();
msg += c;
}
while(Serial.available()) {
delay(3);
char c = Serial.read();
Bt.print(c);
}
if(msg.length() > 0) {
Serial.println(msg);
msg = "";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment