ppm
Dependents: Autonomous_quadcopter
Fork of PPM by
Diff: PpmRegen.h
- Revision:
- 4:380e7c35e466
- Parent:
- 3:2d4d05f95c1a
--- a/PpmRegen.h Wed Sep 27 17:05:59 2017 +0000 +++ b/PpmRegen.h Thu Oct 26 15:53:52 2017 +0000 @@ -2,34 +2,25 @@ #define CH_PPM_IN #include "mbed.h" +#include "definitions.h" class PpmRegen { public: - - static const uint8_t CHANNELS = 6; - uint16_t period; + PpmRegen(InterruptIn* interruptPort); + void getAllChannels(uint16_t all_channels[]); + private: uint16_t channels[CHANNELS+2]; + uint16_t last_channels[CHANNELS+2]; uint16_t corrections[CHANNELS]; - - PpmRegen(PinName InterruptPort, PinName roll, PinName pitch, PinName yaw, PinName throttle, PinName aux1, PinName aux2); + uint8_t current_channel; - void getAllChannels(uint16_t all_channels[]); - void fall(); + void fall(void); void channel_correction(void); - private: - InterruptIn ppmPin; + Timer timer; - uint8_t current_channel; - bool first_reading; - - PwmOut _roll; - PwmOut _pitch; - PwmOut _yaw; - PwmOut _throttle; - PwmOut _aux1; - PwmOut _aux2; + InterruptIn* ppmPin; };