Example program to sweep delay time and turning angle for a standard servo connected to pin D9, with flashing LED D3 according to servo delay time.

Dependencies:   Servo mbed

Files at this revision

API Documentation at this revision

Comitter:
domhardyct
Date:
Tue Nov 11 18:21:12 2014 +0000
Commit message:
Program from Domenico Ardito Catania ITALY. Revision 1 sweeping delay time and turning angle for servo connected to pin D9.

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
diff -r 000000000000 -r 7097ca5bf81d Servo.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Tue Nov 11 18:21:12 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/Servo/#36b69a7ced07
diff -r 000000000000 -r 7097ca5bf81d main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Nov 11 18:21:12 2014 +0000
@@ -0,0 +1,18 @@
+//Created by Domenico Ardito - I.T. Archimede - Catania ITALY
+#include<mbed.h>
+#include<Servo.h>
+DigitalOut myled(LED3);
+Servo myservo(D9); //pin D9 of Arduino
+int main()
+{for(float ritardo=0.1;ritardo<1.0;ritardo+=0.05)
+{
+for(float p=0.0;p<2.0;p+=0.5)
+{myservo=p;
+myled=1;
+wait(ritardo);
+myled=0;
+wait(ritardo);
+}
+
+}
+}
\ No newline at end of file
diff -r 000000000000 -r 7097ca5bf81d mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Nov 11 18:21:12 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/031413cf7a89
\ No newline at end of file