Skip to content

Commit eb8b5ea

Browse files
author
Pascal Langer
committed
JJRC345: update channels range
1 parent 02008a8 commit eb8b5ea

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

Multiprotocol/JJRC345_nrf24l01.ino

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,14 @@ enum JJRC345_FLAGS {
3737
static uint8_t __attribute__((unused)) JJRC345_convert_channel(uint8_t num)
3838
{
3939
uint8_t val=convert_channel_8b(num);
40-
// 7F..01=left, 00=center, 80..FF=right
41-
if(val==0x80)
42-
val=0; // 0
43-
else
44-
if(val>0x80)
45-
val--; // 80..FE
46-
else
47-
{
48-
val=0x80-val; // 80..01
49-
if(val==0x80)
50-
val--; // 7F..01
51-
}
40+
// Should be 70..60..41..01, 80 center, 81..C1..E0..F0
41+
// Trying 7F..01, 80 center, 81..FF
42+
if(val<0x80)
43+
{
44+
val=0x80-val; // 80..01
45+
if(val==0x80)
46+
val--; // 7F..01
47+
}
5248
return val;
5349
}
5450

0 commit comments

Comments
 (0)