4-Way Joystick Control

Control the pan and tilt of a camera with a 4-way joystick.

May 21, 2019

13362 views

3 respects

Apps and platforms

1

Arduino IDE

Project description

Code

Control Pan-Tilt Module with a 4-Way Joystick

arduino

Control Pan-Tilt Module with a 4-Way Joystick

arduino

Downloadable files

Servo Motor Wiring

Servo Motor Wiring

Servo Motor Wiring

Servo Motor Wiring

Limit Switch Wiring

Limit Switch Wiring

Comments

Only logged in users can leave comments

Anonymous user

4 years ago

The wiring to the joystick can be halved and the pulldown resistors removed. Use the built-in pullup resistors in the microcontroller. Steps to make the changes: 1. Connect one side of each of the four limit switches to ground. 2. Connect the other side to Uno pins 6, 7, 8, and 11 as they were originally, but without the resistors. 3. In setup() initialize pins 6,,7,8, and 11 to INPUT_PULLUP. Remove code for pins 2,3,4, 5. 4. When you read the state of the switches, they are the complement of the original (LOW is closed, HIGH is open). So change, for instance "if (joyUp == 1)" to "if (joyUp == LOW)"