Тлен / Mbed 2 deprecated ROVtest

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
spin7ion
Date:
Tue Nov 17 10:44:40 2015 +0000
Parent:
3:c5a79dbed82b
Child:
5:d4e53f381e99
Commit message:
fixed timings

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Nov 17 10:44:09 2015 +0000
+++ b/main.cpp	Tue Nov 17 10:44:40 2015 +0000
@@ -6,7 +6,7 @@
 DigitalOut myled(LED1);
 
 int main() {
-    int servopulsewidth=15000;
+    int servopulsewidth=1500;
     int signer=1;
     
     servo.period_us(20000);          // servo requires a 20ms period
@@ -17,13 +17,13 @@
     while (1) {
         servopulsewidth+=signer;
         
-        if(signer>0 && servopulsewidth>19900){
+        if(signer>0 && servopulsewidth>1990){
             signer=-1;
         }else if(signer<0 && servopulsewidth<10){
             signer=1;
         }
         servo.pulsewidth_us(servopulsewidth);
         servo2.pulsewidth_us(servopulsewidth);
-        wait(0.25);
+        wait(0.05);
     }
 }