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:
- 6:c4c97ac35bc4
- Parent:
- 5:1836bd646986
- Child:
- 7:0a43fd370575
diff -r 1836bd646986 -r c4c97ac35bc4 SBUS.cpp --- a/SBUS.cpp Sat Jun 29 02:37:30 2019 +0000 +++ b/SBUS.cpp Sat Jun 29 02:53:30 2019 +0000 @@ -76,12 +76,11 @@ void SBUS::convertReceivedData() { for(int i = 0; i < 4; i++) { float buf; - if((channel[i] < (stickNeutralValue + 5)) && (channel[i] > (stickNeutralValue - 5))) channel[i] = stickNeutralValue; if(channel[i] > stickNeutralValue) buf = ((channel[i] - stickNeutralValue) / (float)(stickMaximumValue - stickNeutralValue)); else buf = -((channel[i] - stickNeutralValue) / (float)(stickMinimumValue - stickNeutralValue)); switch(i) { case right_RL: - stickValue[analog_rx] = buf; + stickValue[analog_rx] = (int)(buf*100)/100.0f; break; case right_UD: stickValue[analog_ry] = buf;