![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
asdf
Dependencies: Servo mbed mbedConnectorInterface mbedEndpointNetwork
Fork of TempAndDistTest by
Diff: resource/ServoResource.cpp
- Revision:
- 3:c17adf68862b
- Child:
- 4:20feba0e781b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/resource/ServoResource.cpp Sat May 09 18:40:08 2015 +0000 @@ -0,0 +1,23 @@ +#include "ServoResource.h" + +void ServoResource::on() { + servo->Enable(1500, 20000); + while(1) { + for (int pos = 500; pos < 2500; pos += 25) { + servo->SetPosition(pos); + wait_ms(5); + } + for (int pos = 2500; pos > 500; pos -= 25) { + servo->SetPosition(pos); + wait_ms(5); + } + } +} + +void ServoResource::off() { + servo->Disable(); +} + +string ServoResource::get() { + return ""; +} \ No newline at end of file