Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: SBUS.cpp
- Revision:
- 7:0a43fd370575
- Parent:
- 6:c4c97ac35bc4
- Child:
- 8:1294344216eb
diff -r c4c97ac35bc4 -r 0a43fd370575 SBUS.cpp --- a/SBUS.cpp Sat Jun 29 02:53:30 2019 +0000 +++ b/SBUS.cpp Sat Jun 29 02:54:40 2019 +0000 @@ -78,9 +78,10 @@ float buf; if(channel[i] > stickNeutralValue) buf = ((channel[i] - stickNeutralValue) / (float)(stickMaximumValue - stickNeutralValue)); else buf = -((channel[i] - stickNeutralValue) / (float)(stickMinimumValue - stickNeutralValue)); + buf = (int)(buf*100)/100.0f; switch(i) { case right_RL: - stickValue[analog_rx] = (int)(buf*100)/100.0f; + stickValue[analog_rx] = buf; break; case right_UD: stickValue[analog_ry] = buf;