LEARN.PARALLAX.COM
Published on LEARN.PARALLAX.COM (https://learn.parallax.com)

Home > Propeller BlocklyProp Block Reference > Sensor > 2-Axis Joystick

2-Axis Joystick

BlocklyProp reference for 2-AXIS JOYSTICK blocks

Only for Propeller Activity Board WX board type.

These blocks are for Parallax's 2-Axis Joystick (#27800) [1] used only with the A/D converter built into the Propeller Activity Board (original or WX). 

New to this sensor? Click here to see an example schematic and quick Blockly program [2] to help you get started.


Joystick x-axis

BlocklyProp block for Joystick x--axis A/D I/O pin connection selection

The Joystick x-axis block returns the horizontal position of the joystick, which can range from 0 to 100. 

Connect the Joystick's L/R (x-axis) pin to a numbered A/D socket on the Propeller Activity Board WX, and then set the A/D drop-down to that socket's number (0-3).


Joystick y-axis

The Joystick y-axis block returns the vertical position of the joystick, which can range from 0 to 100.

Connect the Joystick's U/D (y-axis) pin to a numbered A/D socket on the Propeller Activity Board WX, and then set the A/D dropdown to that socket's number (0-3).

Joystick Wiring & Example Code

The Parallax 2-Axis Joystick can be used for a wide variety of projects like wheeled robots, video games, or anything requiring user input. The Propeller Activity Board's A/D converter reads the joystick's output on each axis.

Wiring & Connections

 

Quick Code Example

Using the connections shown in the wiring diagram above, this program will show you Joystick Up/Down and Left/Right position values (0-99) in the Terminal.

BlocklyProp code to run a simple Terminal program for the 2-Axis Joystick.

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2022


Source URL: https://learn.parallax.com/support/reference/propeller-blocklyprop-block-reference/sensor/2-axis-joystick

Links
[1] http://www.parallax.com/product/27800
[2] https://learn.parallax.com/support/reference/activity-board-wx-block-reference/sensor/2-axis-joystick/joystick-wiring-example