LedControllerTests
Dependencies: LedController
Fork of ServomotorTests by
Diff: main.cpp
- Revision:
- 1:6e4e8b9d6069
- Parent:
- 0:07953da87c60
- Child:
- 3:47bca612f8ff
diff -r 07953da87c60 -r 6e4e8b9d6069 main.cpp --- a/main.cpp Sat Feb 25 18:59:29 2017 +0000 +++ b/main.cpp Sat Feb 25 22:58:52 2017 +0000 @@ -1,14 +1,19 @@ -#include "mbed.h" - -DigitalOut myled(LED1); +#include "RealPwmOut.hpp" +#include "Servomotor.hpp" int main() { - while(1) + RealPwmOut pwm_out(p21);; + Servomotor target(pwm_out); + + printf("Test: The servo should go from 0 to 90 degrees, and back to 0\r\n"); + + while(true) { - myled = 1; - wait(0.2); - myled = 0; - wait(0.2); + target.set_position_down(); + wait_ms(500); + target.set_position_up(); + wait_ms(500); } + }