Skip to content

Commit 63a22f7

Browse files
committed
Update documentation
1 parent 2c5c27f commit 63a22f7

File tree

1 file changed

+32
-15
lines changed

1 file changed

+32
-15
lines changed

README.md

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
1-
### BETA Testing: This branch is currently being tested. All functions have been implemented and optimized. Feel free to try it out and let me know if you have any issues. The examples are not 100% up-to-date yet.
1+
### BETA Testing
2+
This branch is currently being tested. All functions have been implemented and optimized.
3+
Feel free to try it out and let me know if you have any issues. The examples are not 100% up-to-date yet.
24

35
# Arduino Joystick Library
46
#### Version 2.0.1 (in Beta Testing)
57
This library can be used with Arduino IDE 1.6.6 (or above) to add one or more joysticks (or gamepads) to the list of HID devices an [Arduino Leonardo](https://www.arduino.cc/en/Main/ArduinoBoardLeonardo) or [Arduino Micro](https://www.arduino.cc/en/Main/ArduinoBoardMicro) (or any Arduino clone that is based on the ATmega32u4) can support. This will not work with Arduino IDE 1.6.5 (or below) or with non-32u4 based Arduino devices (e.g. Arduino UNO, Arduino MEGA, etc.).
68

7-
##Installation Instructions
9+
## Features
10+
The joystick or gamepad can have the following features:
11+
- Buttons (default: 32)
12+
- Up to 2 Hat Switches
13+
- X, Y, and/or Z Axis (up to 16-bit precision)
14+
- X, Y, and/or Z Axis Rotation (up to 16-bit precision)
15+
- Rudder (up to 16-bit precision)
16+
- Throttle (up to 16-bit precision)
17+
- Accelerator (up to 16-bit precision)
18+
- Brake (up to 16-bit precision)
19+
- Steering (up to 16-bit precision)
20+
21+
## Installation Instructions
822
Copy the Joystick folder to the Arduino libraries folder (typically `%userprofile%\Documents\Arduino\libraries`). On Microsoft Windows machines, the `deploy.bat` file can be executed to install the Joystick folder (assuming a default Arduino installation). The library should now appear in the Arduino IDE list of libraries. The examples should also appear in the examples menu in the Arduino IDE.
923

10-
##Examples
24+
## Examples
1125
The following example Arduino sketch files are included in this library:
1226

1327
- `JoystickTest` - Simple test of the Joystick library. Exercises many of the Joystick library functions when pin A0 is grounded.
@@ -18,7 +32,7 @@ The following example Arduino sketch files are included in this library:
1832
- `FlightControllerTest` - Creates a Flight Controller and tests 32 buttons, the X and Y axis, the Throttle, and the Rudder when pin A0 is grounded.
1933
- `HatSwitchTest` - Creates a joystick with two hat switches. Grounding pins 4 - 11 cause the hat switches to change position.
2034

21-
###Simple example
35+
### Simple example
2236

2337
#include <Joystick.h>
2438

@@ -52,7 +66,7 @@ The following example Arduino sketch files are included in this library:
5266
delay(50);
5367
}
5468

55-
##Joystick Library API
69+
## Joystick Library API
5670
The following API is available if the Joystick library in included in a sketch file.
5771

5872
### Joystick\_(...)
@@ -155,31 +169,31 @@ Sets the range of values that will be used for the Steering. Default: `0` to `10
155169
### Joystick.setSteering(byte value)
156170
Sets the Steering value. See `setSteeringRange` for the range.
157171

158-
###Joystick.setButton(byte button, byte value)
172+
### Joystick.setButton(byte button, byte value)
159173
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.
160174

161-
###Joystick.pressButton(byte button)
175+
### Joystick.pressButton(byte button)
162176
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.).
163177

164-
###Joystick.releaseButton(byte button)
178+
### Joystick.releaseButton(byte button)
165179
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.).
166180

167-
###Joystick.setHatSwitch(byte hatSwitch, int value)
181+
### Joystick.setHatSwitch(byte hatSwitch, int value)
168182
Sets the value of the specified hat switch. The hatSwitch is 0-based (i.e. hat switch #1 is `0` and hat switch #2 is `1`). The value is from 0° to 360°, but in 45° increments. Any value less than 45° will be rounded down (i.e. 44° is rounded down to 0°, 89° is rounded down to 45°, etc.). Set the value to `JOYSTICK_HATSWITCH_RELEASE` or `-1` to release the hat switch.
169183

170-
###Joystick.sendState()
184+
### Joystick.sendState()
171185
Sends the updated joystick state to the host computer. Only needs to be called if `AutoSendState` is `false` (see `Joystick.begin` for more details).
172186

173-
##Testing Details
187+
## Testing Details
174188
I have used this library to make an Arduino appear as the following:
175189

176190
- 1 joystick / gamepad
177191
- 2 joysticks / gamepads
178192
- 3 joysticks / gamepads
179193
- 4 joysticks / gamepads
180194

181-
I have tested with 1 - 32 buttons. I have also tested this with 1 - 64 buttons.
182-
The standard Microsoft Windows Game Controller Test dialog only supports 32 buttons.
195+
I have tested with 1 - 32 buttons using the standard Microsoft Windows Game Controller Test dialog.
196+
I have also tested this with 1 - 64 buttons.
183197
To test a joystick with over 32 buttons, a third-party testing tool will need to be used (e.g. http://www.planetpointy.co.uk/joystick-test-application/).
184198

185199
I have tested with 0, 1, and 2 hat switches.
@@ -191,6 +205,8 @@ I have tested this library using the following Arduino IDE Versions:
191205
- 1.6.8
192206
- 1.6.9
193207
- 1.6.10
208+
- 1.6.11
209+
- 1.6.12
194210

195211
I have tested this library with the following boards:
196212

@@ -201,8 +217,9 @@ Others have tested this library with the following boards:
201217
- [SparkFun Pro Micro](https://www.sparkfun.com/products/12640)
202218

203219
Other board notes:
204-
- [Arduino Due](https://www.arduino.cc/en/Main/ArduinoBoardDue) - The old Arduino IDE 1.6.5 (and below) version of this library (see [Add USB Game Controller to Arduino Leonardo or Micro](http://mheironimus.blogspot.com/2015/03/add-usb-game-controller-to-arduino.html)) should work with the Arduino Due, and Version 1.x of the new Arduino Joystick Library will work with the Arduino Duo, but Version 2.x of the Arduino Joystick Library does not work with Arduino Due at this time.
220+
- [Arduino Due](https://www.arduino.cc/en/Main/ArduinoBoardDue) - NOT Supported - I have been told that the old Arduino IDE 1.6.5 (and below) version of this library (see [Add USB Game Controller to Arduino Leonardo or Micro](http://mheironimus.blogspot.com/2015/03/add-usb-game-controller-to-arduino.html))
221+
works with the Arduino Due. I have also been told Version 1.x of the the Arduino Joystick Library will work with the Arduino Duo. However, Version 2.x of the Arduino Joystick Library does not work with Arduino Due at this time.
205222
- [Arduino UNO](https://www.arduino.cc/en/Main/ArduinoBoardUno) - NOT Supported - However, it might work with the [NicoHood/HoodLoader2](https://github.com/NicoHood/HoodLoader2) library, but I have not had a chance to try this out yet.
206223
- [Arduino MEGA](https://www.arduino.cc/en/Main/ArduinoBoardMega2560) - NOT Supported - However, it might work with the [NicoHood/HoodLoader2](https://github.com/NicoHood/HoodLoader2) library, but I have not had a chance to try this out yet.
207224

208-
(as of 2016-09-12)
225+
(as of 2016-10-17)

0 commit comments

Comments
 (0)