Luka Slapnik / sbus_decode
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;