NerfUS / Mbed 2 deprecated ServomotorTests

Dependencies:   mbed Servomotor

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "RealPwmOut.hpp"
00002 #include "Servomotor.hpp"
00003 
00004 int main() 
00005 {
00006     RealPwmOut pwm_out(p21);;
00007     Servomotor target(pwm_out);
00008     
00009     printf("Test: The servo should go from 0 to 90 degrees, and back to 0\r\n");
00010     
00011     while(true)
00012     {
00013         target.set_position_down();
00014         wait_ms(500);
00015         target.set_position_up();
00016         wait_ms(500);
00017     }
00018     
00019 }