comunicacion bluetooth
Dependencies: SoftSerial TextLCD mbed
Fork of String_BT by
Diff: main.cpp
- Revision:
- 1:34f5a73ebf6c
- Parent:
- 0:b693dce679a4
- Child:
- 2:38579897448f
--- a/main.cpp Sat Oct 22 14:31:01 2016 +0000 +++ b/main.cpp Sat Mar 11 15:13:00 2017 +0000 @@ -20,27 +20,35 @@ { wait(0.003); //char c = BT.getC(); - BT.gets(c,3); + BT.gets(c,2); readString += c; } if (readString.length()>0) { - pc.printf("%s\r\n",readString); - if (readString == "NO") + pc.printf("%s",readString); + //pc.printf("%s\r\n",readString); + if (readString == "1") { - led=1; + led=!led; + wait(0.5); } if (readString == "FO") { led=0; } + if (readString == ".") + { + pc.printf("\n\r"); + } if (readString == "AL") { measure=ai.read_u16()*0.00005; BT.printf("%f",measure); } readString=""; - + c[0]=' '; + c[1]=' '; + c[2]=' '; } } } \ No newline at end of file