Controlling 4 servos with 3 joystick and a potentiometer using NRF24L01.

I recently wrote code for transmitter and receiver, but for only one servo controlled by one joystick. I don't know what to do next. I am using Arduino Nano as Receiver and Arduino Mega 2560 as the Transmitter. Hey guyz, can you help me by giving the codes for both transmitter as well as receiver. I just said in the topic what I need. I am doing this for my exhibition. Please think be as your brother and help me in this project. If that happens, I won't forget you guyz.

Thanks in advance :slight_smile: :slight_smile:

Hey guyz, can you help me by giving the codes for both transmitter as well as receiver.

No. That's your job.

Put the Arduinos away for a while, and get your wife/mother/little brother/drunken friend to help you.

Figure out what you need to tell the other person to have that person understand which servo to rotate, by how much. Then, get the receiver Arduino out, and modify it to get the necessary data from the packet sent.

Then, get the transmitter Arduino out, and make it send an appropriate packet.

You might, for instance, tell your helper "Move servo 3 to position 46, now". Or you might simplify that to "<3:45>". We have no idea what you will decide.

You might decide, for instance, that every packet will contain 4 values, for each of the 4 servos, like "Move to fortyfive, seventeen, twentysix, and one hundred seventeen, please". Or "<45, 17, 26, 117>".

Each packet format could be parsed, and the data used. Some packets are easier to parse and use than others. Some have complete data for all 4 servos. Some have data for only one servo.

YOU must decide which format to use, or come up with something else.

You can easily send several values in a single nRF24 message. Just decide what data you need to transmit. @PaulS expressed the same idea more colourfully :slight_smile:

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

...R

+1 for Robin2's rf24 tutorial. His serial input basics tutorial snows how to build packets to send and parse received packets.

groundFungus:
His serial input basics tutorial snows how to build packets to send and parse received packets.

The way the nRF24 sends data there is usually no need for parsing. For example it can send an array of ints or a struct and the data can be received directly into an equivalent array or struct.

...R
Serial Input Basics