![](/media/cache/group/GF5017-1-1.jpg.50x50_q85.jpg)
test
Diff: main.cpp
- Revision:
- 0:96e1eeadbd56
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Jan 30 09:49:27 2018 +0000 @@ -0,0 +1,33 @@ +// Hello World to sweep a servo through its full range + +#include "mbed.h" +#include "Servo.h" + +Servo myservo1(D7); +Servo myservo2(D6); + +int main() { + myservo1.calibrate(0.0005,0.0); + myservo2.calibrate(0.0005,0.0); + for(float p=0.87; p>=0.375; p -= 0.005) { + myservo1 = p; + + wait(0.01); + } + wait(2); + for(float n=0.75; n>=0; n -= 0.005) { + myservo2 = n; + wait(0.01); + } + wait(2); + /*for(float p=0.375; p<=0.87; p += 0.005) { + myservo1 = p; + wait(0.01); + } + wait(2); + for(float p=0; p<=0.75; p += 0.005) { + myservo2 = p; + wait(0.01); + } + wait(2);*/ +} \ No newline at end of file