This app allows a Wixel connected to a computer to be used as a joystick. Readings from the Wixel’s analog and digital input pins can represent up to six analog axes and 16 digital buttons or switches. The Wixel appears to the computer as a standard USB Human Interface Device (HID); after the Wixel has been configured, no driver installation is necessary to use the joystick. With a Wixel running the Joystick App, you can easily build a custom USB input device or convert an existing device into a USB peripheral, as this sample project shows.
Connecting Buttons and Potentiometers
The diagrams below show examples of how buttons, switches, and potentiometers can be connected to the Wixel for use with the Joystick App. For a more comprehensive tutorial on wiring these components to build a USB input device with a Wixel, see our USB Wixel Joystick sample project.
Download the Joystick App (v1.0) (33k wxl). Open it with the Wixel Configuration Utility, set any parameters you want to change from the default values, and then write the app to a Wixel. (See Section 4 for more information on how this is done.) The Wixel should now appear to your computer as a Human Interface Device.
If you are using Windows, there should be a new entry called “HID-compliant game controller” in your Device Manager in the “Human Interface Devices” section. The Wixel will also show up as a keyboard and a mouse, but it does not use those interfaces. To test the joystick functions, you can use the Game Controllers applet in the Control Panel, where you should see a “Wixel Joystick” entry. Selecting this entry and clicking the Properties button will display a dialog that shows the state of the joystick’s axes and buttons.
On Linux, the joystick should be represented by a new device node with a name like
The Wixel Configuration Utility does not detect Wixels with USB HID interfaces. Therefore, if you need to reconfigure your Wixel, you will need to manually get it into bootloader mode (set pin P2_2 high and reset – although this app monitors P2_2 all the time and enters the bootloader if it goes high, so the reset is not strictly necessary).
This app’s parameters (detailed below) are used to configure how the Wixel’s inputs map to joystick functions. By default, the six analog inputs P0_0 through P0_5 are mapped to six analog joystick axes, and the six digital inputs P1_2 through P1_7 are mapped to six joystick buttons. Pull-ups are enabled for the buttons, which are configured as inverted inputs (so the Wixel interprets a logic low as a button press). If you don’t need all of the joystick axes, some or all of them can be disabled and the analog pins can be used as digital inputs for additional buttons instead.