NervousPuppySprintTwo
Dependencies: C12832_lcd Servo USBHost mbed
Fork of USBHostSerial_HelloWorld by
Diff: main.cpp
- Revision:
- 9:ea3cfd16b4d9
- Parent:
- 8:eaae889bc6eb
- Child:
- 10:0aa55bd3be36
diff -r eaae889bc6eb -r ea3cfd16b4d9 main.cpp --- a/main.cpp Tue Mar 03 19:32:09 2015 +0000 +++ b/main.cpp Thu Mar 05 16:26:57 2015 +0000 @@ -3,10 +3,10 @@ #include "C12832_lcd.h" #include "Servo.h" -#define RCOUNTERTIME if(posx<=1500) posx+=1; -#define RTIME if(posx>=500) posx-=1; -#define TILTBACK if(posy>=500) posy-=1; -#define TILTFORW if(posy<=1000) posy+=1; +#define RCOUNTERTIME if(posx<=1500) posx+=40; +#define RTIME if(posx>=500) posx-=40; +#define TILTBACK if(posy>=500) posy-=40; +#define TILTFORW if(posy<=1300) posy+=40; #define TEMPORARY rotate.SetPosition(posx); tilt.SetPosition(posy); DigitalOut led1(LED1); @@ -52,7 +52,7 @@ Thread thr1(tild_thread); Thread thr2(rotate_thread); lcd.cls(); - char buffer[128]; + char buffer[2]; rotate.SetPosition(1000); tilt.SetPosition(750); @@ -70,6 +70,11 @@ int x=atoi(buffer); rotate_servo(x); + + for(int i = 0; i < 2; i++){ + buffer[i-1] = 0; + } + //buffer = []; } }