NervousPuppySprintTwo

Dependencies:   C12832_lcd Servo USBHost mbed

Fork of USBHostSerial_HelloWorld by Samuel Mokrani

Files at this revision

API Documentation at this revision

Comitter:
davidqpinho
Date:
Thu Mar 05 16:26:57 2015 +0000
Parent:
8:eaae889bc6eb
Child:
10:0aa55bd3be36
Commit message:
Code updated 05-03

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- 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 = [];
     } 
 }