final product
Dependencies: FRDM_MMA8451Q mbed
Fork of mbed_Pedometer_pressup by
Diff: main.cpp
- Revision:
- 2:b6569bd9af81
- Parent:
- 1:bf4ad12efb64
- Child:
- 4:a8d5a55a89da
diff -r bf4ad12efb64 -r b6569bd9af81 main.cpp --- a/main.cpp Thu Jun 16 14:45:02 2016 +0000 +++ b/main.cpp Thu Jun 16 15:22:50 2016 +0000 @@ -266,9 +266,27 @@ } case 10: { +resp=OKResponse(buffer,"OK"); + if (resp!=NULL) { + INFO("Ready 10"); + dev.printf("AT+CIPSEND=4,9\r\n"); + wait(0.1); + + } + wait(0.1); + // while (OKResponse(buffer,">")!=NULL){ + // printf(".\r\n"); + // wait(1); + // }; + + INFO("SENDING"); + + wait(0.2); + dev.printf("PEDOMETER"); + while (true) { - z = (acc.getAccZ()); - x = (acc.getAccX()); + z = (acc.getAccX()); + x = (acc.getAccZ()); if (a==1.0) { @@ -280,7 +298,7 @@ resp=OKResponse(buffer,"OK"); if (resp!=NULL) { INFO("Ready 10"); - dev.printf("AT+CIPSEND=4,2\r\n"); + dev.printf("AT+CIPSEND=4,4\r\n"); wait(0.1); } @@ -324,6 +342,7 @@ b=1.0; } } + if (b==0) { if (x<0) { b=0.0;