Bチーム / Mbed 2 deprecated 4wd_omni_simple2

Dependencies:   mbed MultiSerial

Files at this revision

API Documentation at this revision

Comitter:
Hatter
Date:
Thu Sep 04 04:51:51 2014 +0000
Parent:
10:5b67d18f30a9
Child:
12:6e2ee1c83ac1
Commit message:
????OK

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Sep 04 02:53:40 2014 +0000
+++ b/main.cpp	Thu Sep 04 04:51:51 2014 +0000
@@ -46,12 +46,10 @@
     xbee_packet *pt_packet=&packet;
     
     xbee.read_data(get_data,XBEE_KEY);        
-    
+    int i=0;
     for(;;){
         
-        wait(0.1);
- 
-        check = !check;  
+        wait_ms(0.1);
         
        // get_data[0]=0xFF;
        // get_data[1]=0x01;    
@@ -69,9 +67,13 @@
         if(packet.leg&0x4) motors = 0x50; //p25,p27        
         if(packet.leg&0x8) motors = 0xA0; //p26,p28
         
-        pc.printf(" arm = %d" ,packet.arm[0]);
-        pc.printf(" leg = %d" ,packet.leg);
+        if(i==10e3){ 
+            pc.printf(" arm = %d" ,packet.arm[0]);
+            pc.printf(" leg = %d" ,packet.leg);
+            i=0;
+        }
         
         armMbed.write_data(pt_packet->arm,ARM_KEY);                  
+        i++;
     }
 }
\ No newline at end of file