для управления турелью

Dependencies:   mbed

Revision:
3:e47c0c98f515
Parent:
0:690effcc5be0
--- a/gun.cpp	Sun Jan 15 22:32:04 2017 +0000
+++ b/gun.cpp	Thu Jan 19 05:22:19 2017 +0000
@@ -1,22 +1,24 @@
 #include "gun.hpp"
 #include "mbed.h"
-#include "rtos.h"
+//#include "rtos.h"
+#include "main.hpp"
 #include "sounds.hpp"
 
-DigitalOut gunPin(PA_13);
-PwmOut outSignalGun(PB_3);
+DigitalOut gunPin(PIN_GUN);
+PwmOut outSignalGun(PIN_OUT_SOUND);
 
 void shotGun(void) {
     gunPin = 1;
     outSignalGun.period(1.0/1500.0); // 1500hz period
     outSignalGun = 0.5; //50% duty cycle - max volume
-    Thread::wait(10);
+    wait(0.02);
     short tik = 0;
     char isStateGun = 1;
     for (short i = 0; i < 1500; i = i + 100) {
         outSignalGun.period(1.0/(float)(1500.0 - i)); 
         outSignalGun = 0.5;
-        Thread::wait(20);
+        //Thread::wait(20);
+        wait(0.02);
         if (tik < 3) {
             tik++;
         } else {