RF24 can`t pass address as array

I am using the RF24 library (GitHub - nRF24/RF24: OSI Layer 2 driver for nRF24L01 on Arduino & Raspberry Pi/Linux Devices) and I want to send a message. When I open the writing pipe like

radio.openWritingPipe(0xF0F0F0F0E1);

it works fine but when i try to store the address in a variable, like

const byte second[5] = {0xF0, 0xF0, 0xF0, 0xF0, 0xE1};
radio.openWritingPipe(second);

something goes wrong (messages are not sent).

What could be the reason?

The address in the second code is an array

What data type does the function take as a parameter ?

The array representation has the opposite byte order.

const byte second[5] = {0xE1, 0xF0, 0xF0, 0xF0, 0xF0};

should work just like the LL variant.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.