M5stack new joystick example
-
Is there an example how to connect the new joystick (I assumd i2c only) to esp32? How to access the joystick status? Also, is it delivered with firmware installed?
-
@YigalB I2C is correct.
Here is the example:
https://github.com/m5stack/M5Unit-Joystick2/blob/main/examples/get_value/get_value.ino
The internal firmware is already installed and like most M5Stack Units it is 'permanent' and does not require your attention but could theoretically be updated in the future. -
@teastain Thank you! Exactly what I needed to know.
Another thing that bothers me: When looking at the I2C protocol in the documentation, it states the "I2C address" is RW (read write).
- I assume the Write part is in order to change the address - probably in order to include 2 joysticks at same time. Is this command stored on a non volatile memory? Or is it needed to be executed every power up?
- if 2 joysticks are connected in parallel, how is it possible to direct the command from the master to a specific one?
Of course, if the answer to 1 is yes, this can be easily done with step by step.
(or if there are jumpers on board the joystick). -
@YigalB Two Joysticks would require a PaHub accessory from M5Stack:
https://shop.m5stack.com/products/i2c-hub-1-to-6-expansion-unit-pca9548apw
These work very well, seamlessly.
I don't know how to change the I2C address of the Joystick in this register, sorry. -
@teastain Yes, using I2C splitter is a practical solution for using I2C devices with same address. I use it often.
Yet the "Write" ability caught my attention, since it is saving the need for the splitter.I will try approaching the customer service.
-