Skip to content

Instantly share code, notes, and snippets.

@Azuxul
Created Apr 9, 2016
Embed
What would you like to do?
#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