![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
asdf
Dependencies: Servo mbed mbedConnectorInterface mbedEndpointNetwork
Fork of TempAndDistTest by
resource/ServoResource.cpp
- Committer:
- mnorris
- Date:
- 2015-05-09
- Revision:
- 4:20feba0e781b
- Parent:
- 3:c17adf68862b
File content as of revision 4:20feba0e781b:
#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 ""; } void ServoResource::put(const string input) { if (input == "on") { on(); } else { off(); } }