Arduino – Control Servos with Joystick (remote)
We know how to make Servo move with Joystick in previous lessons.
but furthermore, we're going to learn how we can control Servos with Joystick in remote! ?
As you already know, we need both sender and receiver sides.
- Transmitter
- Receiver
Let's take a look at Software side.
If anyone does not know 'How to upload our sketch to Arduino', then please click the following article before you go.
As this is remote version of controlling servos, we need both sender and receiver.
- Sender
Step 1) Include necessary libraries
Step 2) Declare variables for Joystick position and pins we want to use with
Step 3) Implement setup function
Step 4) Implement loop function
Step 4-1) Read Analog values from Joystick
Step 4-2) Map the values into ones which can be used in Servo position
Step 4-3) Send resultant position values to receiver
The full codes are available at RF433Sender_RadioHead_ServoControl.ino
- Receiver
Step 1) Include necessary libraries
Step 2) Declare variables for driver and Servo pins
Step 3) Implement setup function
Step 4) Implement loop function
Step 4-1) Check if we received data
Step 4-2) Retrieve Servo positions and write them into Servo motors
The full codes are available at RF433Receiver_RadioHead_ServoControl.ino
Leave a Reply
Want to join the discussion?Feel free to contribute!