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:
- 13:17a61a516f0c
- Parent:
- 12:ac222684f449
- Child:
- 14:481c23f2e4eb
diff -r ac222684f449 -r 17a61a516f0c SBUS.cpp --- a/SBUS.cpp Sat Jul 13 08:31:01 2019 +0000 +++ b/SBUS.cpp Mon Jul 15 00:50:24 2019 +0000 @@ -76,8 +76,8 @@ void SBUS::convertReceivedData() { for(int i = 0; i < 4; i++) { float buf; - if(channel[i] > (stickNeutralValue + 15)) buf = ((channel[i] - stickNeutralValue) / (float)(stickMaximumValue - stickNeutralValue)); - else if(channel[i] < (stickNeutralValue - 15)) buf = -((channel[i] - stickNeutralValue) / (float)(stickMinimumValue - stickNeutralValue)); + if(channel[i] > (stickNeutralValue + 20)) buf = ((channel[i] - stickNeutralValue) / (float)(stickMaximumValue - stickNeutralValue)); + else if(channel[i] < (stickNeutralValue - 20)) buf = -((channel[i] - stickNeutralValue) / (float)(stickMinimumValue - stickNeutralValue)); else buf = 0.0f; buf = (int)(buf*100)/100.0f; buf = (buf > 1.0f) ? 1.0f : buf;