This example demonstrates the reading of the USB Gamepad in the Nucleo.

Dependencies:   mbed

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

/media/uploads/beaglescout007/nucleo_ex04_usbpad.png This circuit diagram was created by fritzing.

/media/uploads/beaglescout007/usbcon.jpg

USB con.Nucleo
GNDGND
+PA_12
-PA_11
5V5V

https://youtu.be/EYIukjwJSew

Original Library

USBHost/mydebug.h

Committer:
beaglescout007
Date:
2016-03-15
Revision:
0:b5f79b4f741d

File content as of revision 0:b5f79b4f741d:

#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");
}