A PPM driver for the K64F that uses the CMT module
Diff: PPMout.cpp
- Revision:
- 1:9b1734761ce3
- Parent:
- 0:04365c9c9994
diff -r 04365c9c9994 -r 9b1734761ce3 PPMout.cpp --- a/PPMout.cpp Fri Sep 02 11:48:31 2016 +0000 +++ b/PPMout.cpp Fri Sep 02 16:01:52 2016 +0000 @@ -27,6 +27,9 @@ // Constrain channel channel = PIN(channel, 0, (CHANNELS-1)); + + // Correction + channel = (channel*2 + 1)%CHANNELS; // Calculate new step value int steps = (int) (RANGE_STEPS*value + ZERO_STEPS);