Charles Tritt / Mbed 2 deprecated MyServo_HelloWorld

Dependencies:   mbed Servo

Files at this revision

API Documentation at this revision

Comitter:
CSTritt
Date:
Thu May 06 13:44:45 2021 +0000
Parent:
2:7709000dbbc4
Commit message:
Minor clean-up for smoother motion and quieter waiting.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu May 06 02:22:30 2021 +0000
+++ b/main.cpp	Thu May 06 13:44:45 2021 +0000
@@ -14,14 +14,14 @@
 
 int main() { 
    for (int q=1; q < 6; q++) { 
-        for (float p=0; p < 1.0; p += 0.1) {
+        for (double p = 0; p < 1.0; p += 0.05) {
             myServo = p;
-            wait(0.2);
+            wait(0.1);
         }
     }
     while (true) {
         float hold = 0.5;
         myServo = hold; // Wait here forever.
-        wait(0.2);
+        wait(1.0);
     }
 }
\ No newline at end of file