Created
December 3, 2015 14:24
-
-
Save xeonqq/bd01f04fb03ba5fb92e8 to your computer and use it in GitHub Desktop.
try to find the baudrate of the bluetooth module (not tested)
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
void tryBT() | |
{ | |
delay(20000); | |
led_green_flash(); | |
long baudrates[5] = {9600, 19200, 38400, 57600, 115200}; | |
String inputString=""; | |
for (int i =0; i< 5; i++) | |
{ | |
DebugSerial.begin(baudrates[i]); // debug output | |
DebugSerial.println("AT"); | |
while (DebugSerial.available()) | |
{ | |
char inChar = (char)DebugSerial.read(); | |
inputString += inChar; | |
} | |
if (inputString == "OK") | |
{ | |
LogSerial.printf("found baud: %ld", baudrates[i]); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment