I am using UNOs, nRF20L01s, and TMRh20 RF24.h.
My addressing setup is:
// Collective listing of slave addresses done this way to
// facilitate the opening of reading pipes using a loop
// to assign consecutive addresses
uint64_t slaveAddresses[6] = { 0xF0F0F0F0AA,
0xF0F0F0F0BB,
0xF0F0F0F0CC,
0xF0F0F0F0DD,
0xF0F0F0F0EE,
0xF0F0F0F0FF };
// These individual slave names are dependant on the
// collective listing. Using them makes addressing
// a slave more 'English-like'.
const uint64_t SLAVE_0 = slaveAddresses[0];
const uint64_t SLAVE_1 = slaveAddresses[1];
const uint64_t SLAVE_2 = slaveAddresses[2];
const uint64_t SLAVE_3 = slaveAddresses[3];
const uint64_t SLAVE_4 = slaveAddresses[4];
const uint64_t SLAVE_5 = slaveAddresses[5];
...
// Open all the reading pipes with their individual addresses.
// This loop iterates through the *collective listing of unit
// addresses* discussed above.
for (int i = 0; i < 6; i++)
{
radio.openReadingPipe(i, slaveAddresses[i]);
} // end for (int i = 0;
I open a pipe
openWritingPipe(SLAVE_0);
all works well. Now I wish to address another slave so I
openWritingPipe(SLAVE_1);
and the transmission fails. Apart from the slave address nothing has changed - the same code is called with the address as a parameter.
Does the second openWritingPipe() call not overwrite and override the first?
How do I change from one slave address to the other?