Joystick (2 axes) with TinkerPie
Read X on one pin and Y on another. The push button goes to a digital pin.
| Type | Analog sensors |
|---|---|
| Connect to | VRx and VRy to two of P10-P13 |
| Gives | -100 to 100 per axis |
| Simulator | Yes: a control appears under the simulated board |
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)