I'm going to say right up front, I'm stupid. I'm a 70 year old trying to grasp the concept of this marvelous invention. I've been reading online for sometime and trying to incorporate the nrf24l01 into some VERY basic projects. I'm having problems with the abstract procedure of sending "commands" from one unit to another. New people coming into this would think, the transmitting unit would directly tell the receiving unit what to do, and it does it. But I'm gathering, that's not how it is done. So I'm asking for correction, if the next concept is inaccurate. Arduino1 is configured with (say) a pin 7 input. You tell it, if pin 7 reads high, write an array with the data of "111" inside. ... send transmission of this data "111" out to whoever is listening. The receiving arduino is set to listen; "if" it hears "111", then it needs to do something. In sketch, it says (for instance) "digitalWrite" the pin 9 HIGH and turns on buzzer. Is that the big picture of how it works?
The transmitter sends a code, that code is translated at the destination into what to do. The meaning of the codes is entirely down to how the receiving program interprets them.
I don’t know why you say write an array with “111” inside, other than 111 in binary is 7 decimal?
You could do it that way, but if all you need to send in ON or OFF for a single pin, much easier to just send a single byte/character. For example:
‘0’ which you will interpret as OFF for pin 7 at the receiver
‘1’ which you will interpret as ON for pin 7 at the receiver
Of course, if you have more pins, or more complex data you need to convey, then a single character may not cut it and you will require a more complex encoding scheme.
Don't beat yourself up too badly the nrf24l01 sketches are going to be confusing at first. So there are examples sketches for that board when the "RF24" library by TMRh20 is used. So I would start with the "gettingstarting" example.
All that example does is send the round trip time back and forth to each other.
Some times if an adapter for those modules are not used a capacitor from vcc to ground may be needed.
I found Robin2's simple rf24 tutorial to be helpful.
I'm going to say right up front, I'm stupid. I'm a 70 year old trying to grasp the concept of this marvelous invention.
The only stupid thing is imagining that your age makes any difference. I'm 68.
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 in the link in Reply #3 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
There is also a connection test program to check that the Arduino can talk to the nRF24 it is connected to.
A common problem with nRF24 modules is insufficient 3.3v current from the Arduino 3.3v pin. This seems to be a particular problem with the nano. The high-power nRF24s (with the external antenna) will definitely need an external power supply. At least for testing try powering the nRF24 with a pair of AA alkaline cells (3v) with the battery GND connected to the Arduino GND.
If you are using the high-power nRF24s (with the external antenna) make sure there is sufficient distance between the two nRF24s so that the signal does not overwhelm the receiver - try 3 metres separation. If you are new to nRF24s it may be better to start with a pair of low power modules with the pcb antenna.
Thank you guys for your tutelage. I have read through the sketch examples, I have read Robin2's very informative writings, and I have read through many, many more. I just get more confused. I suppose my issue is that through the many many examples I've read, they are ALL different. I understand that there are many ways to skin a cat, but throughout the examples there is not a consistent methodology of using varibles, types of varibles, where they are placed (like global varibles, vs placing them in the Setup.) Like, some people will list "led" above "Setup" to use it as global, whereas some coders won't list it at all and just say in the "Setup" something like "pinMode(8 = OUTPUT);" One of the very simple examples of wireless code, simple used a button on one board to light up a led on the other board. Cool, that's what I want. But, in the code it was talking about the value of the temperature being ==18.3... what??? As you know, on Youtube there are not dates that the video was made. So I don't know if I'm watching technology from 1992 or 2020. I sure coding has evolved over the years, so I'm not only tring to learn what to do, but also trying to decifer if I'm watching a video on the "old" rf24 library, or the new library, or if it even makes a difference. Please don't think I'm complaining, I'm not. I'm just trying to expain why its hard for an outside to grasp some of this. One thing I would like to know is why are some radio addresses written as specific hexidecimal and other are any 5 letters or numbers? Thanks.
I am not sure what I can do to help. I am also 70 and have been learning C++ for about 5 years. Even after that amount of time I consider myself a medium level coder at best. I suggest that you find some basic level tutorials to get a feel of the language. The language reference has descriptions and examples for most of the Arduino specific functions.
The issue with the addresses is mostly just personal preference, I think.
I suppose my issue is that through the many many examples I've read, they are ALL different.
IMHO the easiest way out of your confusion is to pick one example and work with it. Don't try to understand all the variants, or even which is best (if there is such a thing) at this early stage of your learning.
As your experience grows you will begin to be able to understand the variants, and in many cases to understand that the variations are insignificant - different coding styles but not different in substance.
Like I said earlier, wireless problems can be difficult to debug and if you start with one of the examples from my Tutorial it will make it easier to help you. If there are parts that you don't understand feel free to ask questions about it.
Thank you guys. In listening to what you guys have said has really helped. I'm THINK I'm starting to understand the philosophy on how this works. I know I have a lot of studying to do. I really appreciate your help, knowledge, and patience.