A PPM driver for the K64F that uses the CMT module
Revision 1:9b1734761ce3, committed 2016-09-02
- Comitter:
- Padman
- Date:
- Fri Sep 02 16:01:52 2016 +0000
- Parent:
- 0:04365c9c9994
- Child:
- 2:4570e00696b9
- Commit message:
- Some adjustments to correct channel number error
Changed in this revision
PPMout.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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);