![](/media/cache/profiles/b5c4ec91390a6fbccf8d918d443563ed.jpg.50x50_q85.jpg)
acd52832_servo example
Revision 0:a855473fe62b, committed 2016-09-20
- Comitter:
- jurica238814
- Date:
- Tue Sep 20 11:36:12 2016 +0000
- Commit message:
- acd52832_servo example
Changed in this revision
diff -r 000000000000 -r a855473fe62b Servo.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Servo.lib Tue Sep 20 11:36:12 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/simon/code/Servo/#36b69a7ced07
diff -r 000000000000 -r a855473fe62b main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Sep 20 11:36:12 2016 +0000 @@ -0,0 +1,18 @@ +// Continuously sweep the servo through it's full range +#include "mbed.h" +#include "Servo.h" + +Servo myservo(p26); + +int main() { + while(1) { + for(int i=0; i<100; i+=2) { + myservo = i/100.0; + wait(0.05); + } + for(int i=100; i>0; i-=2) { + myservo = i/100.0; + wait(0.05); + } + } +}
diff -r 000000000000 -r a855473fe62b mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Sep 20 11:36:12 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/abea610beb85 \ No newline at end of file