The examples provided for the RadioHead NRF24 client and server are great but deal with only one line of communication. By that I mean the receiving radio understands that something has been sent and does not care what that was. Perfect for a one button solution turning on a LED. However my project has two buttons on the transmitter and I need to understand how the button 1 press transmitting "Aloha" will be processed by the receiver (say light up a yellow LED) differently than a button 2 press transmitting "WoogaWoogaWooga" that would light up a blue LED. In other words, I need the receiver to react differently (that part I have handled) based on the information it receives.
My particular problem is finding documentation on how the RadioHead library/protocol works upon reception. This may be pilot error on my part but honestly, I have tried.
What are your thoughts?
Thanks in advance.
I have no experience of the Radiohead library. The TMRh20 library that I use allows full access to the nRF24 features.
Have a look at this Simple nRF24L01+ Tutorial.
Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.
The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work
The RadioHead library receive function simply indicates that a valid packet has been received, fills the buffer that the calling function provides (with a size that you specify), and returns the number of bytes put into the buffer.
Documentation and code
What you do with the buffer is up to you. One byte could indicate up to 8 switch settings, for example.
Thank you both for awesome and informative replies. Much appreciated.