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
Diff: USBHost/mydebug.h
- Revision:
- 0:b5f79b4f741d
diff -r 000000000000 -r b5f79b4f741d USBHost/mydebug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/USBHost/mydebug.h Tue Mar 15 11:39:04 2016 +0000 @@ -0,0 +1,14 @@ +#pragma once +template<class SERIAL_T> +void debug_hex(SERIAL_T& pc, const uint8_t* buf, int size) +{ + for(int i = 0; i < size; i++) { + pc.printf("%02x ", buf[i]); + if (i%16 == 15) { + pc.puts("\n"); + } + } + pc.puts("\n"); +} + +