From eb8b5eac0135dd55643337cc05ce273d7af8c435 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Thu, 21 May 2020 11:56:08 +0200 Subject: [PATCH] JJRC345: update channels range --- Multiprotocol/JJRC345_nrf24l01.ino | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/Multiprotocol/JJRC345_nrf24l01.ino b/Multiprotocol/JJRC345_nrf24l01.ino index 33ba941e0..c540d21c7 100644 --- a/Multiprotocol/JJRC345_nrf24l01.ino +++ b/Multiprotocol/JJRC345_nrf24l01.ino @@ -37,18 +37,14 @@ enum JJRC345_FLAGS { static uint8_t __attribute__((unused)) JJRC345_convert_channel(uint8_t num) { uint8_t val=convert_channel_8b(num); - // 7F..01=left, 00=center, 80..FF=right - if(val==0x80) - val=0; // 0 - else - if(val>0x80) - val--; // 80..FE - else - { - val=0x80-val; // 80..01 - if(val==0x80) - val--; // 7F..01 - } + // Should be 70..60..41..01, 80 center, 81..C1..E0..F0 + // Trying 7F..01, 80 center, 81..FF + if(val<0x80) + { + val=0x80-val; // 80..01 + if(val==0x80) + val--; // 7F..01 + } return val; }