中継機能つけた受け取りオムニ

Dependencies:   mbed MultiSerial

Revision:
28:4da223ae4392
Parent:
27:68f76ea992bd
Child:
29:7a8efb8a9af8
--- a/main.cpp	Tue Oct 07 08:55:58 2014 +0000
+++ b/main.cpp	Tue Oct 07 09:51:52 2014 +0000
@@ -63,7 +63,8 @@
 void display_LED(int kind){
 
     switch(kind){
-        case 0:
+        
+        case 0: //err check
             check = 0xA;
             wait(0.5);
             check != 0xF;
@@ -72,9 +73,10 @@
             break;
             
         case 1:
-
+                //
             check = 0xF;
-
+            wait(0.5);
+            check = 0;
             break;
         }
     }
@@ -123,11 +125,9 @@
     armMbed.start_write();
     armMbed.write_data(pt_packet->arm,ARM_KEY);
     
-    
+    display_LED(1);
     
-    display_LED(1);
-    wait(0.5);
-    if((packet.leg&L_U)==0){NVIC_SystemReset();} 
+    int counter=0;
     
     for(;;) {
 
@@ -138,10 +138,11 @@
         packet.leg = get_data[0];
 
         //check = get_data[1];
-            
-        check = packet.leg;   
+        counter++;
+        check = counter/100;
+        if(counter>=15*100){counter=0;}
+        
     
-    /*
     if(xbee.readable_check() == 0) {
  
             radio_check++;
@@ -154,7 +155,6 @@
  
             radio_check = 0;
     }
-    */
         
         /* Stop */
     if(packet.leg==0x0) {