Hi un1x:
un1x:
Do you know how to set a lower data rate ?
I've found this command online:
Mirf.configRegister(0x26,0x07); //Air data rate 1Mbit, 0dBm, Setup LNA
is it correct ? I can't find any detailed guideline for Mirf library .....
I am afraid not. The register to set is the 0x06, not 0x26. And if I remember correctly, you should zero every bit of this register, except bits 2:1 (that gives you maximal output power). Thus, you would want to write the value of 0x06 to this register. Actually, the mirf-lib comes with a predefined value for the register address. Thus
// Set 1MHz data rate
Mirf.configRegister(RF_SETUP,0x06);
should to the trick. Since the least significant bit of this reg is ignored, 0x07 is actually equivalent to 0x06 in this case.
But please check the data sheet of the device, page 58 for details before proceeding. I am recalling this from memory....
For CRC errors I'm transmitting a payload of 13 bytes with these commands:
Mirf.payload = 13;
byte data[Mirf.payload];
data[0] = ....;
data[1] = ....;
................
data[12] = ....;
Mirf.send(data);
I need to trasmitt lot of values.
Well, that is basically correct. But note that the Mirf-lib (at least my version) does not like byte*, so an explicit cast needs to be done. Also remember that your chip might try to retransmit the data several times if you have enabled Shockburst (which I strongly recommend). So the following piece of code is probably a slightly better approach:
Mirf.payload = 13;
byte data[Mirf.payload];
// ... fill in your data into your array
// hand over to transmitter
Mirf.send((byte*)data);
// give the chip the time to transmit (and retransmit in case of errors)
while( Mirf.isSending() ) ;