Skip to content

Commit

Permalink
JJRC345: update channels range
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Langer committed May 21, 2020
1 parent 02008a8 commit eb8b5ea
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions Multiprotocol/JJRC345_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit eb8b5ea

Please sign in to comment.