6.1 Servo Richtung, Tasten links, rechts. Anwendung: Roboterarm bewegen.

Dependencies:   Servo mbed

Files at this revision

API Documentation at this revision

Comitter:
marcel1691
Date:
Wed Mar 04 16:11:42 2015 +0000
Commit message:
6.1 Servo Richtung, Tasten links, rechts.; Anwendung: Roboterarm bewegen.

Changed in this revision

Servo.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Wed Mar 04 16:11:42 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/simon/code/Servo/#36b69a7ced07
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Mar 04 16:11:42 2015 +0000
@@ -0,0 +1,25 @@
+/** 6.1 Servo Richtung, Tasten links, rechts.
+    Anwendung: Roboterarm bewegen.
+*/
+#include "mbed.h"
+#include "Servo.h"
+
+DigitalIn button1( PTC9 );
+DigitalIn button2( PTC0 );
+
+Servo servo1 ( A5 );
+
+int main()
+{
+    // Mittelstellung
+    servo1 = 0.5f;
+    
+    while (true) 
+    {
+        if  ( button1 == 0 && servo1.read() > 0.0f )
+            servo1 = servo1.read() - 0.01f;
+        if  ( button2 == 0 && servo1.read() < 1.0f )
+            servo1 = servo1.read() + 0.01f;
+        wait(0.2f);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Mar 04 16:11:42 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7e07b6fb45cf
\ No newline at end of file