This example demonstrates the reading of the USB Gamepad in the Nucleo.
Intro
This example demonstrates the reading of the USB Gamepad in the Nucleo.
Parts
STM32 Nucleo F446RE |
USB Connector |
LED 2pcs |
Register 470 ohm 2pcs |
Breadboard |
Wires |
Wiring diagram
This circuit diagram was created by fritzing.
USB con. | Nucleo |
---|---|
GND | GND |
+ | PA_12 |
- | PA_11 |
5V | 5V |
Original Library
- F401RE-USBHost by Norimasa Okamoto
- USBHostGamepad by Yuuichi Akagawa
USBHost/mydebug.h@0:b5f79b4f741d, 2016-03-15 (annotated)
- Committer:
- beaglescout007
- Date:
- Tue Mar 15 11:39:04 2016 +0000
- Revision:
- 0:b5f79b4f741d
Release
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
beaglescout007 | 0:b5f79b4f741d | 1 | #pragma once |
beaglescout007 | 0:b5f79b4f741d | 2 | template<class SERIAL_T> |
beaglescout007 | 0:b5f79b4f741d | 3 | void debug_hex(SERIAL_T& pc, const uint8_t* buf, int size) |
beaglescout007 | 0:b5f79b4f741d | 4 | { |
beaglescout007 | 0:b5f79b4f741d | 5 | for(int i = 0; i < size; i++) { |
beaglescout007 | 0:b5f79b4f741d | 6 | pc.printf("%02x ", buf[i]); |
beaglescout007 | 0:b5f79b4f741d | 7 | if (i%16 == 15) { |
beaglescout007 | 0:b5f79b4f741d | 8 | pc.puts("\n"); |
beaglescout007 | 0:b5f79b4f741d | 9 | } |
beaglescout007 | 0:b5f79b4f741d | 10 | } |
beaglescout007 | 0:b5f79b4f741d | 11 | pc.puts("\n"); |
beaglescout007 | 0:b5f79b4f741d | 12 | } |
beaglescout007 | 0:b5f79b4f741d | 13 | |
beaglescout007 | 0:b5f79b4f741d | 14 |