Final Version of food controller
Dependencies: MMA8451Q TSI mbed
Fork of foodcontroller_NoWiFi by
Diff: main.cpp
- Revision:
- 8:047d427da574
- Parent:
- 7:c19655dbdef7
- Child:
- 9:de6dd11d89ba
diff -r c19655dbdef7 -r 047d427da574 main.cpp --- a/main.cpp Fri Jun 10 09:14:01 2016 +0000 +++ b/main.cpp Fri Jun 10 12:05:09 2016 +0000 @@ -41,22 +41,6 @@ bool right; //Right or left? right = 1 bool forward; //Forward or Backward? forward = 1 -/* -int main() -{ - - pc.printf("hello\n\r"); - for(int c=0; c<14;c++) - { - pc.printf("work %d\n\r",c); - rled = 0; - wait(0.2); - rled = 1; - wait(0.2); - } -}*/ - - void setupWiFi() { @@ -220,14 +204,14 @@ pc.printf("Direction = %d \r\n", Direction); //Print the direction variable to screen for debugging //Only send data to the server if the direction has changed - if(Direction != PrevDirection || Velocity != PrevVelocity) + if(Direction != PrevDirection || Velocity != PrevVelocity) { //Send Direction and Velocity to server - //dev.printf("AT+CIPSEND=0,11\r\n"); + // dev.printf("AT+CIPSEND=0,11\r\n"); //wait(2); - dev.printf("1dir%dvel%d\r\n",Direction,Velocity); //Identifier,Direction Tag,Direction Value,Velocity Tag,Velocity Value + //dev.printf("1dir%dvel%d\r\n",Direction,Velocity); //Identifier,Direction Tag,Direction Value,Velocity Tag,Velocity Value PrevDirection = Direction; PrevVelocity = Velocity;