nRF24L01+ demo using ackPayload

CrossRoads:
byte would have been sufficient as the data used is <= a value of 255.

As the program is written it increments ackData[0] indefinitely so it gets some value from the int.

If @Stump_Jumper does wish to change the data type there must be a matching change in the other program.

...R

This should help thanks
I will be checking for a button press 1 or 0 converting to 111 or 000 to send over the ackPayload.

Hi all.
I am referring to post 16 by Robin and the comments that follow:
I have uploaded the respective code to 2 UNO and they are both displaying the expected printout as far as the values go, however the ack section ( as was noted by another member) is not displaying

    bool rslt;
    rslt = radio.write( dataToSend, sizeof(dataToSend) );
    Serial.print("\nRSLT (1 = success) ");
    Serial.println(rslt);
    if ( radio.isAckPayloadAvailable() ) {
        radio.read(ackMessg,ackMessgLen);
        Serial.print("Acknowledge received: ");
        Serial.print(ackMessg[0]);
        Serial.print("  ");
        Serial.println(ackMessg[1]);

my typical printout:-

RSLT (1 = success) 0
Data Sent 4624 4625

to my understanding, the zero should change to 1 and the ack statements should be printed.

I appreciate that asking for the corrected code is not the best way to learn, but i have spent a lot of time trying to figure this out and am still no wiser, so if you would...the corrected code please. :slight_smile:

I am using the latest Library,as listed, and would like to stay with it, as it seems to work ok.

Like most people, it would appear, it has taken me some time to get this far, finding a working library that has simple examples available is not that easy.

I wrote a more recent and more comprehensive Simple nRF24L01+ Tutorial. I suggest you try the examples in that. They do work :slight_smile:

...R

Hey, is there a way to reset the nrf24l01 com, like switch the communication of and the on again?

ddmdavid01:
Hey, is there a way to reset the nrf24l01 com, like switch the communication of and the on again?

AFAIK the only way to reset the device is to disconnect it from the power. I know it does not reset when you press the Arduino reset button.

However communication is not continuous. It only happens for a brief instant when you send a message.

...R

I was able to get the Ack replies working with Robin2's code above. You have to add the following lines of code to the Master sketch. I added them after radio.enableAckPayload();

radio.setAutoAck(true);
radio.enableDynamicPayloads();
radio.stopListening();



Thanks Robin2 for all of your hard work!

wiremonkey:
Thanks Robin2 for all of your hard work!

Thank you for your kind words.

Have you looked at my newer Simple nRF24L01+ Tutorial

...R

wiremonkey:
I was able to get the Ack replies working with Robin2's code above. You have to add the following lines of code to the Master sketch. I added them after radio.enableAckPayload();

radio.setAutoAck(true);
radio.enableDynamicPayloads();
radio.stopListening();

To which program do you think the statements have to be added?

I doubt that any of those option are not enabled if used by the sketch.
And stopping to listen does not make much sense in Standby-I, it is still/already stopped.