This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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