Skip to content

Instantly share code, notes, and snippets.

@xeonqq
Created December 3, 2015 14:24
Show Gist options
  • Select an option

  • Save xeonqq/bd01f04fb03ba5fb92e8 to your computer and use it in GitHub Desktop.

Select an option

Save xeonqq/bd01f04fb03ba5fb92e8 to your computer and use it in GitHub Desktop.

Revisions

  1. xeonqq created this gist Dec 3, 2015.
    26 changes: 26 additions & 0 deletions try_bluetooth_function.c
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    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]);

    }

    }

    }