Library for generating servo pulses from mbed output pins
Dependents: mbed_ES20X_Tester MadPulseCntrl ES413Integration Emaxx_Navigation ... more
Fork of SERVOGEN by
ServoOut Library
Assign the ServoOut object (output pin) a value in microseconds to change the servo pulse. Note that the default range is between 900 and 2100 microseconds.
Library for generating servo pulses using the Ticker class
include the mbed library with this snippet
// ServoOut Class test program // J. Bradshaw 20140925 #include "mbed.h" #include "ServoOut.h" ServoOut servo1(p21); ServoOut servo2(p24); DigitalOut led1(LED1); int main() { servo1.pulse_us = 0; // spin in a main loop. flipper will interrupt it to call flip while(1) { for(float cycle=0.0;cycle<2.0*3.14159;cycle+=.003){ //small amplitude sine wave on servo1 servo1 = 300 * sin(cycle) + 1500; //ramp up the second servo2 channel relative to cycle servo2 = 1000 + cycle*159; // .001/(2*PI) wait(.001); //short delay } led1 = !led1; //toggle led1 to indicate activity }//while(1) }//main
Changes
Revision | Date | Who | Commit message |
---|---|---|---|
6:6a59017c4f62 | 2015-04-10 | jebradshaw | ServoOut - First revision (renamed from SERVOGEN) of ServoOut library to generate servo pulses from mbed output pins. |
5:74d2f30b4dd6 | 2015-04-10 | jebradshaw | ServoOut - library for generating servo output pulses using the Ticker class |
4:7043ab96dd4a | 2015-04-09 | jebradshaw | Servo Pulse Generator Object Library |
3:edc18509ff11 | 2014-09-29 | jebradshaw | Added operator accessible read/writes to simplify use; J Bradshaw 20140929 |
2:44766ee77ce0 | 2014-09-28 | jebradshaw | updated on 20140928 |
1:7d669a801bb0 | 2014-09-26 | jebradshaw | Servo pulse generation library; v1.0 |
0:67dd4036010a | 2014-09-26 | jebradshaw | J. Bradshaw 20140926; Working servo pulse generation library using Ticker class. |