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: README.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,8 +51,8 @@ The following API is available if the Joystick library in included in a sketch f
51
51
###Joystick\_.Joystick\_(...)
52
52
Constructor used to initialize and setup the Joystick. The following optional parameters are available:
53
53
54
-
-uint8\_t hidReportId - Default: 0x03 - Indicates what the joystick's HID report ID should be. This value must be unique if you are creating multiple instances of Joystick. Do not use 0x01 or 0x02 as they are used by the built-in Arduino Keyboard and Mouse libraries.
55
-
-uint8\_t buttonCount - Default: 32 - Indicates how many buttons will be available on the joystick.
54
+
-`uint8_t hidReportId` - Default: `0x03` - Indicates what the joystick's HID report ID should be. This value must be unique if you are creating multiple instances of Joystick. Do not use `0x01` or `0x02` as they are used by the built-in Arduino Keyboard and Mouse libraries.
55
+
-`uint8_t buttonCount` - Default: `32` - Indicates how many buttons will be available on the joystick.
56
56
57
57
###Joystick.begin(bool initAutoSendState)
58
58
Starts emulating a game controller connected to a computer. By default all methods update the game controller state immediately. If initAutoSendState is set to false, the Joystick.sendState method must be called to update the game controller state.
@@ -79,13 +79,13 @@ Sets the Y axis rotation value. Range 0° to 360°.
79
79
Sets the Z axis rotation value. Range 0° to 360°.
80
80
81
81
###Joystick.setButton(byte button, byte value)
82
-
Sets the state (0 or 1) of the specified button (0 - 31). The button is the 0-based button number (i.e. button #1 is 0, button #2 is 1, etc.). The value is 1 if the button is pressed and 0 if the button is released.
82
+
Sets the state (0 or 1) of the specified button (range: 0 - (buttonCount - 1)). The button is the 0-based button number (i.e. button #1 is 0, button #2 is 1, etc.). The value is 1 if the button is pressed and 0 if the button is released.
83
83
84
84
###Joystick.pressButton(byte button)
85
-
Press the indicated button (0 - 31). The button is the 0-based button number (i.e. button #1 is 0, button #2 is 1, etc.).
85
+
Press the indicated button (range: 0 - (buttonCount - 1)). The button is the 0-based button number (i.e. button #1 is 0, button #2 is 1, etc.).
86
86
87
87
###Joystick.releaseButton(byte button)
88
-
Release the indicated button (0 - 31). The button is the 0-based button number (i.e. button #1 is 0, button #2 is 1, etc.).
88
+
Release the indicated button (range: 0 - (buttonCount - 1)). The button is the 0-based button number (i.e. button #1 is 0, button #2 is 1, etc.).
89
89
90
90
###Joystick.setThrottle(byte value)
91
91
Sets the throttle value. Range 0 to 255.
@@ -100,7 +100,8 @@ Sets the value of the specified hat switch. The hatSwitch is 0-based (i.e. hat s
100
100
Sends the updated joystick state to the host computer. Only needs to be called if AutoSendState is false (see Joystick.begin for more details).
101
101
102
102
##Testing Details
103
-
I used this library to make an Arduino appear as 1, 2, 3, and 4 joysticks / gamepads.
103
+
I used this library to make an Arduino appear as 1, 2, 3, and 4 joysticks / gamepads.
104
+
I have tested with 1 - 32 buttons.
104
105
105
106
I have tested this library using the following Arduino IDE Versions:
106
107
@@ -113,4 +114,4 @@ I have tested this library with the following boards:
0 commit comments