mark w. / Mbed 2 deprecated Nucleo_Gamepad

Dependencies:   USBDevice mbed

You are viewing an older revision! See the latest version

Homepage

This project is based off the Pinscape_Controller which is targeted for a different device than my nucleo F411RE board.

I have tried a few USBJoystick sample projects but none had the number of buttons I needed.

The goal of this project is to built an interface that I will connect numerous Arcade buttons and joystick (2) to the Nucleo board, and the Nucleo will present itself as a USB Gamepad to Windows. The joysticks are Arcade joysticks that have four switches, up/down/left/right. It is not an analog joystick, just a set of switches. These will be connected to the Nucleo's pins configured as inputs.

The code will then continously poll (loop) and test which buttons are closed, and transfer this data to the host via USBJoystick protocol.

This code is based on the USBJoystick logic from Pinscape_Controller MBed project to make this project. It is currently not working (12/12/2016) as I am getting a USB Device Descriptor error in Windows.

Connecting USB cable to the board is as follows:

You will need a USB data cable (the one I used had a micro usb on one end and regular usb on the other). I cut off the micro USB end, and cut the insulation back about 30mm. This exposed four wires, Red, Black, White and Green. You will then either crimp some header connectors or solder directly to the Nucleo header pins as follows:

  • Green USB D+ to D12
  • White USB D- to D11
  • Red USB 5V to E5V
  • Black USB GND to GND

On the Nucleo board you may have difficulties depending on the revision. The board I am using is an STM32F411RE Revision 103, which has resistors and solder joints (bottom) to allow the use of the Crystal on the STLink board for USB purposes. After programming via STLink, remove the USB cable from the STLink, the jumper must be set to E5V to power the board from the PC's usb port. Plug the new cable into the PC.


All wikipages