Hello,
I am communicating between two arduino's using 2 nrf24l01+ modules. I've basically got it working but want to get some additional info of the modules. This information is located in the module register.
This library is used to read data out of the register:
void Nrf24l::readRegister(uint8_t reg, uint8_t * value, uint8_t len)
// Reads an array of bytes from the given start position in the MiRF registers.
{
csnLow();
Spi.transfer(R_REGISTER | (REGISTER_MASK & reg));
transferSync(value,value,len);
csnHi();
}
and this is an example of a register read:
uint8_t Nrf24l::getStatus(){
uint8_t rv;
readRegister(STATUS,&rv,1);
return rv;
}
Complete library: Arduino Playground - HomePage
I would like to read some RF_SETUP information out of the register:
http://www.nordicsemi.no/files/Product/data_sheet/nRF24L01P_Product_Specification_1_0.pdf
See page: 58
The RF_SETUP information is stored into one byte (correct me if I am wrong!!). but how do I print for example the RF_PWR value (2 bits)?
This is what I have tried in my Sketch
byte rv;
Mirf.readRegister(RF_SETUP, &rv, 8);
Serial.print(rv);
But this prints rubbish....
The problem is I don't know what length to choose? Now I have tried 8. And how do I print this value correct?
Anyone who knows how this stuff works?
Thanks in advance.
/me