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.
Revision 0:7097ca5bf81d, committed 2014-11-11
- 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
--- /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
--- /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
--- /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