My thought was that they're just way out of sync and when one is writing the other isn't necessarily listening. So I tried adding while (radio.available()) {} loops for it to wait before reading, but that just makes it freeze.
Any other reasons? Did I make the code too simple?
The actual ICs doing the communication require an ACK to ensure the transmission was received. Adding data to the return ACK message is just icing on the cake!
Paul
The normal case is that there is one part which is defined as the transmitter.
There is another part defined as the receiver.
The receiver part is always ready and listening for signals from the transmitter part.
The NRF24L01 protocol handles packet acknowledgement (ack) re transmission requests, Integrity checks (CRC) etc.
You appear to have mixed transmitting and receiving and ask about "ack".
If you have requirements which differ from the normal case, for example 2 way communication, state what they are.
Right after the section on the ack payload there is the section and code for the Two-way transmission by swapping roles. Isn't that what you are trying to do.
@6v6gt sorry if not clear. I want to send an initial value (0) from transmitter, then the receiver adds +1 and sends it back, then transmitter adds +0.01 and sends back and so on and so on. Preferably without any extra overhead like data ack, for now.
@groundFungus yes, I also had tried to edit it to my liking (emphasis on tried). So instead of messages it just sends integers and counts them up, but that also didn't work. Saved a little edit where I show what I had changed. Not like I changed anything critical, right? Just changed the type of data sent.
*Mostly just changed the data from arrays to integers and in the update cycle did so it counts up those integers.
So decided to try make an even more bare-bones version of that.
Eh, realised I've bitten off more than I can chew anyways. Remade my project so one-way communication would be enough - just wanted it to be a bit extra.
But it would still be interesting to know why this didn't work, if anyone has a clue.