You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/units/joystick2.rst
+30-30Lines changed: 30 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,24 @@
1
1
2
-
JoystickV2Unit
2
+
JoystickUnit
3
3
==============
4
4
5
-
.. include:: ../refs/unit.joystickv2.ref
5
+
.. include:: ../refs/unit.joystick2.ref
6
6
7
7
The joystick is an input unit for control, utilizing an I2C communication interface and supporting three-axis control signals (X/Y-axis analog input for displacement and Z-axis digital input for key presses). It is ideal for applications like gaming and robot control.
8
8
9
9
Support the following products:
10
10
11
-
|JoystickV2Unit|
11
+
|JoystickUnit|
12
12
13
13
Micropython Example::
14
14
15
15
import os, sys, io
16
16
import M5
17
17
from M5 import *
18
-
from unit import JoystickV2Unit
18
+
from unit import JoystickUnit
19
19
from hardware import *
20
20
i2c = I2C(1, scl=22, sda=21)
21
-
joystick = JoystickV2Unit(i2c)
21
+
joystick = JoystickUnit(i2c)
22
22
joystick.read_adc_value()
23
23
joystick.read_button_status()
24
24
joystick.set_rgb_led(255, 0, 0)
@@ -33,18 +33,18 @@ UIFLOW2 Example:
33
33
34
34
.. only:: builder_html
35
35
36
-
class JoystickV2Unit
36
+
class JoystickUnit
37
37
--------------------
38
38
39
39
Constructors
40
40
------------
41
41
42
-
.. class:: JoystickV2Unit(i2c, address)
42
+
.. class:: JoystickUnit(i2c, address)
43
43
44
-
Initialize the JoystickV2 Unit.
44
+
Initialize the Joystick Unit.
45
45
46
46
:param I2C i2c: I2C port to use.
47
-
:param int address: I2C address of the JoystickV2 Unit.
47
+
:param int address: I2C address of the Joystick Unit.
0 commit comments