JOYSTICK

SKU:U024

Description

JOYSTICK, M5Stack has two types of JOYSTICKs: one is compatible with FACES Kit and this one, which is a M5Unit version of ther other JOYSTICK device.

JOYSTICK is very similar to the 'analog' joystick on PS2 (PlayStation 2) controllers. The X and Y axes are two 10k potentiometers which control 2D movement by generating analog signals. The joystick also has a push button that could be used for special applications. Therefore, the entire Unit can output X-Y motion signals in both directions and Z direction.

Based on the schematic, the Joystick X dimension is connected to pin A0 of MEGA328, the Joystick Y dimension is connected to pin A1 on MEGA328, the Joystick Z dimension is connected to pin A2 on MEGA328.

This Unit communicates with the M5Core via the GROVE A interface. It's I2C address is 0x52. By reading the data transferred from JOSTICK, you can obtain the motion information of JOYSTICK.

Product Features

  • Output value of X, Y direction: 10 ~ 250
  • Output value of Z direction is (0: released; 1: pressed)
  • Software Development Platform : Arduino, UIFlow(Blockly, Python)
  • Two Lego-compatible holes

Include

  • 1x JOYSTICK Unit
  • 1x Grove Cable

Applications

  • Game Controller
  • Robot remote control

Specification

Resources Parameter
Communication protocol I2C:0x52
X、Y Axis output value range 10-250
Z Axis output value range 0-1
Net weight 11g
Gross weight 27g
Product Size 48*24*32mm
Package Size 75*45*30mm

EasyLoader

EasyLoader is a concise and fast program writer, which has a built-in case program related to the product. It can be burned to the main control by simple steps to perform a series of function verification.

Download Windows Version Easyloader Download MacOS Version Easyloader

Description:
Show joystick XY data and button status.

PinMap

Mega328 ISPDownload interface Pin foot definition

M5Core(GROVE A)GPIO22GPIO215VGND
JOYSTICK UnitSCLSDA5VGND

Protocol

  • Protocol type I2C
  • I2C Address: 0x52

JOYSTICK REG 0x52

REG len description return values
0x52 3 Read joystick status [0] X VALUE
[1] Y VALUE
[2] BTN STATUS

Schematic

Learn

Wireless Gamepad with ESP32 and BLE
Gamepad (prototype) based on M5StickC (ESP32 Pico) with I2C joystick module, dual button unit, and Bluetooth Low Energy connectivity.

Example

Arduino

UIFlow

Feature Introduction

The joystick is actually a potentiometer that can be automatically reset, sliding different displacements to output different voltage signals.

  • Get X Return data on the X axis

  • Get Y Return data from the Y axis

  • Get is pressed Return the value of the button

  • Get Reverse X Return X-axis reverse data

  • Get Reverse Y Return Y-axis reverse data

Usage

Last updated: 2020-12-11