Xbox 360 Wireless Controller for Windows library

Dependencies:   USBHost USBHostXpad mbed

Fork of USBHostMSD_HelloWorld by Samuel Mokrani

Xbox 360 Wireless Controller for Windows

Microsoftの XBOX 360 ワイヤレスコントローラーを、パソコン用のUSB接続型レシーバーで mbed に接続して使えるライブラリです。
ワイヤードのXBOX360コントローラーや、初代XBOXコントローラーのコードも含んでいますが未確認です。

USB Host 機能を使いますので mbed LPC1768 専用です。

たまに usb_thread could not read dev descr を出力して処理が停止する不具合があります。

/media/uploads/samux/usb_host_schema.jpg

Import libraryUSBHostXpad

Xbox 360 Wireless Controller for Windows library. sample: http://mbed.org/users/okini3939/code/USBHostXpad_HelloWorld/

Files at this revision

API Documentation at this revision

Comitter:
samux
Date:
Wed Mar 06 17:06:56 2013 +0000
Child:
1:473f339c54c1
Commit message:
USBHostMSD Hello World

Changed in this revision

USBHost.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/USBHost.lib	Wed Mar 06 17:06:56 2013 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/mbed_official/code/USBHost/#a554658735bf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Mar 06 17:06:56 2013 +0000
@@ -0,0 +1,40 @@
+#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 USB flash disk
+        while(!msd.connect())
+            Thread::wait(500);
+        
+        FILE * fp = fopen("/usb/test.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");
+        }
+        
+        // wait until the msd disk is disconnected
+        while(msd.connected())
+            Thread::wait(500);
+    }
+}
+
+
+int main() {
+    Thread msdTask(msd_task, NULL, osPriorityNormal, (1024+512) * 4);
+    while(1) {
+        led=!led;
+        Thread::wait(500);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Mar 06 17:06:56 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/5e5da4a5990b
\ No newline at end of file