Cynthia Wang / Mbed 2 deprecated ECE4180-FinalProject

Dependencies:   mbed-rtos mbed Servo Motor SoftPWM

Revision:
8:c54f1cfcbfe0
Parent:
7:f65ab31f81e7
Child:
9:0b045f2791ea
--- a/main.cpp	Wed Nov 16 01:35:20 2022 +0000
+++ b/main.cpp	Thu Nov 17 21:41:57 2022 +0000
@@ -3,10 +3,11 @@
 #include "Serial.h"
 #include "Servo.h"
 #include "Motor.h"
+#include "SoftPWM.h"
 
 RawSerial blue(p9, p10);
 Serial pc(USBTX, USBRX);
-PwmOut servo(p24);
+SoftPWM servo(p24, true);
 Motor left_motor(p23, p15, p16); // pwm, fwd, rev
 Motor right_motor(p22, p17, p18); // pwm, fwd, rev
 
@@ -62,7 +63,7 @@
         else if (pulsewidth < 0.001) pulsewidth = 0.001;
         servo.pulsewidth(pulsewidth);
         
-        Thread::wait(50);
+        Thread::wait(25);
     }
 }
 
@@ -88,7 +89,7 @@
     lives_leds = 7;
 
     thread_drive.start(drive_thread);
-    //thread_turret.start(turret_thread);
+    thread_turret.start(turret_thread);
     thread_ir_receive.start(ir_receive_thread);
     
     input_loop();