This library allows an Arduino board with USB capabilites to act as a Basic 2-axis Joystick. This library is based on the HID library.
This library is simplified based on my preferences from other similar Arduino libraries. It does not include a full kitchen sink HID descriptor, but rather only enough for a simple arcade stick or basic gamepad. It also has a minimal code interface, which requires a little bit more C knowledge than the average Arduino library.
To use it, include BasicJoystick.h in your sketch, then declare a global or static instance of type JoyState_t. In the loop method, update each of the members of this variable to their desired values (e.g. axis value, button pressed, etc.), then pass your JoyState_t variable to setState() to update the states reported to the USB host.
Refer to the included TwoButtonDigitalPad example for more details.
The default variant of this library supports 10 buttons, using SNES-style terminology. At least one other variant is maintained in a different branch in this repository. Refer to BasicJoystick.h for the full set of supported button fields for the branch in use.
Copyright (c) Ryan Armstrong. All right reserved.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA