Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of Nucleo_Ex04_USBPAD by
main.cpp
00001 #include "mbed.h" 00002 #include "USBHostGamepad.h" 00003 00004 USBHostGamepad *pad; 00005 00006 // LED 00007 DigitalOut red(PB_5); 00008 DigitalOut yellow(PA_10); 00009 00010 int main() 00011 { 00012 // USB Gmaepad Initialize 00013 pad = new USBHostGamepad(); 00014 if (!pad->connect()) { 00015 printf("USB Gamepad not found.\r\n"); 00016 while(1); 00017 } 00018 00019 while(1) 00020 { 00021 USBHost::poll(); 00022 00023 red = pad->report[4] & 0x20; 00024 yellow = pad->report[4] & 0x40; 00025 00026 printf("%02x %02x %02x %02x %02x %02x %02x %02x\r\n", pad->report[0],pad->report[1],pad->report[2],pad->report[3],pad->report[4],pad->report[5],pad->report[6],pad->report[7]); 00027 wait_ms(16); 00028 } 00029 }
Generated on Tue Jul 12 2022 21:16:08 by
1.7.2
