Xbox 360 Wireless Controller for Windows library
Dependencies: USBHost USBHostXpad mbed
Fork of USBHostMSD_HelloWorld by
Xbox 360 Wireless Controller for Windows
Microsoftの XBOX 360 ワイヤレスコントローラーを、パソコン用のUSB接続型レシーバーで mbed に接続して使えるライブラリです。
ワイヤードのXBOX360コントローラーや、初代XBOXコントローラーのコードも含んでいますが未確認です。
USB Host 機能を使いますので mbed LPC1768 専用です。
たまに usb_thread could not read dev descr を出力して処理が停止する不具合があります。
Import libraryUSBHostXpad
Xbox 360 Wireless Controller for Windows library. sample: http://mbed.org/users/okini3939/code/USBHostXpad_HelloWorld/
main.cpp
- Committer:
- samux
- Date:
- 2013-03-12
- Revision:
- 1:473f339c54c1
- Parent:
- 0:0d68fe822228
- Child:
- 2:3e3df7a79050
File content as of revision 1:473f339c54c1:
#include "mbed.h" #include "USBHostMSD.h" DigitalOut led(LED1); void msd_task(void const *) { USBHostMSD msd("usb"); int i = 0; while(1) { // try to connect a MSD device while(!msd.connect()) { Thread::wait(500); } while(1) { FILE * fp = fopen("/usb/test1.txt", "a"); if (fp != NULL) { fprintf(fp, "Hello fun SD Card World: %d!\r\n", i++); printf("Goodbye World!\r\n"); fclose(fp); } else { printf("FILE == NULL\r\n"); } Thread::wait(500); // if device disconnected, try to connect again if (!msd.connected()) break; } } } int main() { Thread msdTask(msd_task, NULL, osPriorityNormal, (1024+512) * 4); while(1) { led=!led; Thread::wait(500); } }