Kurang Servo Flap

Dependencies:   Motor Servo_Test mbed

Fork of Servo_test by KRAI 2017

Revision:
0:ac3026899cce
Child:
1:d5adf9f6ca32
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Oct 29 13:48:08 2016 +0000
@@ -0,0 +1,22 @@
+// Continuously sweep the servo through it's full range
+#include "mbed.h"
+#include "Servo.h"
+
+Servo myservo(PC_8);
+
+int main() {
+    wait_ms(100);
+    myservo.position(-90);
+    wait_ms(2000);
+    while(1) {
+        for(int i=-90; i<=90; i++) {
+            myservo.position(i);
+            wait(0.01);
+        }
+        for(int i=90; i>-90; i--) {
+            myservo.position(i);
+            wait(0.01);
+        }
+    }
+   
+}