riyas-org / nrf24scannerPi

A poor mans 2.4Ghz scanner ported for raspberry pi
5 stars 7 forks source link

Is odd number channels also scan in scanner.cpp? #2

Open ccy opened 7 years ago

ccy commented 7 years ago

In file nrf24scannerPi/scanner.cpp:

void scanChannels(void)
{
...
    for( int i=0 ; i<CHANNELS ; i++)
    {
      // select a new channel
      setRegister(_NRF24_RF_CH,(128*i)/CHANNELS);

The value of (128*i)/CHANNELS will go from 0, 2, 4, 6, ..., 126

It looks like only it scan for even number channels only. How about odd number channels? Will it scan too?

Berryfier commented 4 years ago

Looking on the nRF24L01 data sheet at 6.3 for RF channel frequency it says "at 2Mbps ... the channel spacing must be 2MHz or more". Looking at scanner.cpp line 218 has setRegister(_NRF24_RF_SETUP, 0x0F) which sets the Data Rate to 2Mbps. If you want to look meaningfully at the odd channels, then better set Data Rates of 1Mbps or 250kbps