Class Library for reading hobby servos and detecting invalid or disconnected channels
Dependents: MadPulseCntrl Emaxx_Navigation Emaxx_Navigation_Dynamic_HIL Madpulse_Speed_Control_temp ... more
ServoIn Class Library
This class library uses external interrupts with timer functions to read servos pulses on mbed input pins.
ServoIn Library usage example
#include "mbed.h" #include "ServoIn.h" DigitalOut led1(LED1); ServoIn servoIn1(p15); ServoIn servoIn2(p14); Serial pc(USBTX, USBRX); // tx, rx int main() { pc.baud(921600); //Fast baud rate while(1) { led1 = 1; wait(0.05); led1 = 0; wait(0.05); pc.printf("servo pulse: CH1=%5dus CH2=%5dus\r\n", servoIn1.read(), servoIn2.read()); } }
Changes
Revision | Date | Who | Commit message |
---|---|---|---|
5:598ccee73ed3 | 2017-08-14 | jebradshaw | added check for valid servo pulse when greater then servo max to prevent flag check after pulse interrupt (inverted pulse measure phase) |
4:379f9ab5cb4b | 2016-08-04 | jebradshaw | Added digital pin and constructor initial state test |
3:19c8eaf905e9 | 2015-05-21 | jebradshaw | Tests for reading calibrated pulse within range or returns (float)0.0. |
2:07273d6016e9 | 2015-05-09 | jebradshaw | Reads servo input pulses using an external interrupt and tiimer function |
1:b7cc6da72d09 | 2015-04-15 | jebradshaw | ServoIn Class Library with invalid pulse detection |
0:98a3b6fbd242 | 2015-04-14 | jebradshaw | ServoIn - First class library 20150414; Joe Bradshaw |