Arduino & Joystick

Tonight we’ll learn how to use a joystick with an arduino. This is the kind of device that’s extremely simple to use and can be of great service. With such equipment, you can control a robot, a car, an airplane or even your recently robotized grandmother…

The material:
– a joystick. I got one from home Adafruit for $5. Afterwards, if you get a Playstation joystick, you will find two almost identical inside.
– an arduino, regardless of which
– Done!

A little theory:
What is a joystick? Nothing more than two potentiometers: one for the front/rear axis, one for the left/right axis.

The schematic:
On the joystick you will see several indications:
– GND: to the ground
– L/R+: +5V (or other, see the datasheet with your joystick). This is feeding left/right pot
– L/R: will go on an analog input on the arduino
Repeat the last two steps for the U/D+ and U/D pins.

Once everything is wired properly, you should get something like this:

Now the source code. Here again simple, but it’s only a base:

A short capture of the serial monitor

capture

  • André Gustavo

    Ok, but how to make windows take the values and user this properly.
    I´m not able to find a way yet.
    Could you help me?

    thanks,
    André

    • deadbird

      In order to calibrate the panel you must use the software provided with the driver.