RF24 / NRF24L01 - Can I set "setPALevel" on the fly ??


i have been using basic pcb antenna nrf24l01+ devices 8 pin header lot of testing

i have found situation these jiggers put out power application, (its complex go right now)

i have been setting radio.setpalevel(rf24_pa_high); believe high setting available on pa+lna version

so guess drops default setting,

so powerlevels have ...
rf24_pa_min = -18dbm, rf24_pa_low = -12dbm, rf24_pa_high = -6dbm, rf24_pa_max = 0dbm

if want swap between 2 power levels need powerdown radio first ?
can change on fly ?

does have other info ?

and answer yes !

snippet....

code: [select]
void loop()
{
  if (millis() - refreshtimer > 5000) {
    radio.powerup();
    refreshtimer = millis();
    digitalwrite(led,high);
    delay(100);
    (x=0; x<3; x++) {
      radio.setpalevel(power[x]);    // power[0] = rf24_pa_min, [1] = low, [2] = high
      radio.openwritingpipe(rxtxaddress[0]);
      payload[1] = x; // byte containing power level
      radio.stoplistening();
      radio.write( payload, sizeof(payload) );
      radio.startlistening();
     
      radio.openwritingpipe(rxtxaddress[1]);
      radio.stoplistening();
      radio.write( payload, sizeof(payload) );
      radio.startlistening();
      delay(10);
    }
    radio.powerdown();
    digitalwrite(led,low);
  }



Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > RF24 / NRF24L01 - Can I set "setPALevel" on the fly ??


arduino

Comments