TINKER PiEDESIGN IN INDIA

Joystick (2 axes) with TinkerPie

Read X on one pin and Y on another. The push button goes to a digital pin.

TypeAnalog sensors
Connect toVRx and VRy to two of P10-P13
Gives-100 to 100 per axis
SimulatorYes: a control appears under the simulated board

How it works

A joystick has two knobs (potentiometers) inside, one for left-right (X) and one for up-down (Y), plus a push button under the stick. TinkerPie turns each axis into a number from -100 to 100, with 0 in the middle.

How to wire it

Plug the module's A0 / OUT into P10 (or P11-P13 when Wi-Fi is off), VCC to 3.3 V, GND to GND.

Code

In blocks: Accessories category in TinkerPie Studio. As code:

// JavaScript
sensors.joystick(Pin.P10)

// Arduino C++
sensors::joystick(Pin::P10)

Good to know

Projects with the Joystick (2 axes)

Joystick pixel painterSteer a green dot around the matrix with a joystick.Sensor projects

Similar modules

More projects to try

Questions

Can I try the Joystick (2 axes) without buying one?

Yes. In TinkerPie Studio the simulator shows a control for it under the board, so you can test your program before you build it.

Why does my robot move slowly when I am not touching the joystick?

The stick does not rest at exactly 0. Treat values between -10 and 10 as 0 in your code.