you could use ATC and set your target RSSI. This could be best, since it will change as link changes.
Other way is to set fixed power with radio.setPowerLevel();
With HW, you have 16 steps, so 31 and 30 will the same 20dB level. non H version has 32 steps
void RFM69::setPowerLevel(uint8_t powerLevel)
{
_powerLevel = (powerLevel > 31 ? 31 : powerLevel);
if (_isRFM69HW) _powerLevel /= 2;
writeReg(REG_PALEVEL, (readReg(REG_PALEVEL) & 0xE0) | _powerLevel);
}
Its a bit more complex than this, since it is relevant if you have PA1+PA2 turned on, if you have PA_Boost turned on or if you have
Output power will depend on:
//if (_isRFM69HW) setHighPowerRegs(true);
if (_isRFM69HW) setHighPowerRegs(false);
which is
void RFM69::setHighPowerRegs(bool onOff) {
writeReg(REG_TESTPA1, onOff ? 0x5D : 0x55);
writeReg(REG_TESTPA2, onOff ? 0x7C : 0x70);
}
and
and
///* 0x11 */ { REG_PALEVEL, RF_PALEVEL_PA0_ON | RF_PALEVEL_PA1_OFF | RF_PALEVEL_PA2_OFF | RF_PALEVEL_OUTPUTPOWER_11111}
where you can see last bit is setPowerLevel(), so you don't change that, you do it with setPowerLevel(). And PA0,PA1 and PA2 can be turn on and off. Just read which one you can have and which one you can't. Default is PA0 = off, PA1 and 2 are on
also setHighPowerRegs() is on
you can make simple sketch and play with this, turning different things on and off via serial port (or compile sketch each time)