nRF24l01+ TIMER - Relay

Eu quero acionar relés usando o nRF24l01+ através de um timer, mas estou com problemas, o modulo não envia a variavel. Alguém pode me ajudar?
I want to drive relays using NRF24L01 + via a timer, but I’m in trouble, the module does not send the variable. Can someone help me?

Tx_nRF24l01.ino (1.6 KB)

Rx_nRF24l01.ino (741 Bytes)

This Simple nRF24L01+ Tutorial may help.


What type of variable should I send to turn on the relay?

Any type will work as long as it has on and off meanings. Since the radio has to send at least one byte then a value of zero means all relays are off and any bit set means that particular one is on. Use Robin's suggestion to get it running then expand on that scheme.

Take one of the bytes and use bitWrite() on the TX end to set the bit values and bitRead() on the RX end to interpret the meaning of each bit.

Thank you friends.
The variable data [0] = 0 would not be sending in byte format? Ja changed int data [4] paw byte data [4], but it does not work
I already tested the robin's code but did not compile, I am using RF library Mabiacbub

if(myRTC.hours=23 && myRTC.minutes >= 59){
//digitalWrite(5, HIGH);
//digitalWrite(4, HIGH);
//digitalWrite(3, HIGH);
if(myRTC.hours=22 && myRTC.minutes >= 59){
if(myRTC.hours=21 && myRTC.minutes >= 59){
if(myRTC.hours=20 && myRTC.minutes >= 59){
//bool ok = radio.write(data, 1);

radio.write(data, 1);

I am using RF library Mabiacbub

I think you will find that my Tutorial said NOT to use that version.


Sorry, I had not seen. Thanks, I'll try to use your code and adjust to what I want to do.

thank you very much, Robin and Arctic_Eddie !!! Is so good! it works!!!