Joystick HAT is one of the HAT module that is specifically designed for M5StickC. We have used a STM32F030F4 microprocessor inside to implement I2C communication with M5StickC.This mini-volume joystick module supports full angular movement and center press, and outputs angular data as well as button digital signals.With the 'HAT' unified plug-in design it can provide reliable connection, in the most streamlined way. which allows to get more HMI experience.
Resources | Parameter |
---|---|
Communication protocol | I2C:0x38 |
Net weight | 8g |
Gross weight | 16g |
Product Size | 24*30*17mm |
Package Size | 42*40*30mm |
1.EasyLoader is a simple and fast program burner. Every product page in EasyLoader provides a product-related case program. It can be burned to the master through simple steps, and a series of function verification can be performed.
M5StickC | GPIO0 | GPIO26 | 3.3V | GND |
---|---|---|---|---|
Joystick HAT | SDA | SCL | 3.3V | GND |
I2C address: 0x38
Register:
0x01 Read only 4 bytes, single axis value 0 ~ 4096
0: low 8 bits of raw data on X-axis
1: high 8 bits of raw data on X-axis
2: low 8 bits of raw data on Y-axis
3: high 8 bits of raw data on Y-axis
0x02 only read 3 bytes
0: x-axis data after transform ( -127 ~ 127)
1: y-axis data after transform ( -127 ~ 127)
`2: 0 or 1 (press down 0, release 1).
0x03 only write 1 bytes
0x00: Normal mode
0x01: Central spot set 0
0x02: Maximum Calibration (Require manually rotate the joystick to get the maximum value).
0x03: Save central spot and Maximum Calibration value to flash, and go to Normal Mode after finish.
Joystick calibration method:First i2c writes register 0x03 and then sends 0x02, the joystick is rotated several times around the top, bottom, left and right, and then 0x03 is saved in register 0x03.