Grenade Drone Controller

Dependencies:   mbed

Revision:
1:d2b6491e52fd
Parent:
0:02ed82ccad9f
Child:
2:915533cf5d94
--- a/SwitchFn/SwitchFn.cpp	Mon Jul 16 02:29:10 2018 +0000
+++ b/SwitchFn/SwitchFn.cpp	Fri Jul 20 06:11:24 2018 +0000
@@ -22,7 +22,18 @@
     Snd2Crr.putc(SigBit);
     Snd2Crr.putc(SigBit);
     Snd2Crr.putc(0xff);
-    Snd2Crr.putc(0xff);    
+    Snd2Crr.putc(0xff);
+    
+    //test//////////////////
+    if(SigBit&0x80) Led1=1;
+    if(SigBit&0x40) Led2=1;
+    if(SigBit&0x20) Led3=1;
+    if(SigBit&0x10) Led4=1;
+    if(SigBit&0x08) Led5=1;
+    if(SigBit&0x04) Led6=1;
+    if(SigBit&0x02) Led7=1;
+    if(SigBit&0x01) Led8=1;
+    ///////////////////////////
 }
 
 void ProcCrr(void) {RcvBit=Snd2Crr.getc();}
@@ -122,7 +133,7 @@
     else if(fSw14==2&&Sw14==0)
     {
         fSw14=3;
-        if((SigBit&0xf0)==0x00){SigBit|=0xf0; myled1=1;}
+        if((SigBit&0xf0)!=0xf0){SigBit|=0xf0; myled1=1;}
     }
     else fSw14=0;
 }
@@ -133,7 +144,7 @@
     else if(fSw58==2&&Sw58==0)
     {
         fSw58=3;
-        if((SigBit&0x0f)==0x00){SigBit|=0x0f; myled2=1;}
+        if((SigBit&0x0f)!=0x0f){SigBit|=0x0f; myled2=1;}
     }
     else fSw58=0;   
 }
@@ -144,7 +155,7 @@
     else if(fSwAll==2&&SwAll==0)
     {
         fSwAll=3;
-        if((SigBit&0xff)==0x00){SigBit|=0xff; myled4=1;}
+        if((SigBit&0xff)!=0xff){SigBit|=0xff; myled4=1;}
     }
     else fSwAll=0; 
 }