Grenade Drone Controller

Dependencies:   mbed

Revision:
0:4194aba3f887
Child:
1:903bcc4d9628
diff -r 000000000000 -r 4194aba3f887 GranadeCtrl.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GranadeCtrl.cpp	Mon Jul 16 06:49:15 2018 +0000
@@ -0,0 +1,33 @@
+#include "mbed.h"
+#include "PinAssign.h"
+#include "GlobalVars.h"
+#include "Functions.h"
+
+bool fSndTimer=0;
+
+Timeout SndTimer;
+void SndTimer_isr(void) {fSndTimer=1;}
+
+int main() 
+{
+    SndTimer.attach(&SndTimer_isr,1);
+    InitPWM();
+    
+    pc.baud(115200);
+    Switch.baud(9600);
+    
+    while(1) 
+    {
+        if(fSndTimer==1)
+        {
+            fSndTimer=0;
+            
+            SndPWM();
+            SigBit=RcvBit;
+            Switch.putc(SigBit);
+            
+        }
+        
+        if(Switch.readable()) RcvProc();
+    }
+}