test cord of WiiClassicController

Dependencies:   WiiClassicController mbed

Files at this revision

API Documentation at this revision

Comitter:
kambara1415
Date:
Thu Jun 16 03:41:29 2016 +0000
Commit message:
??????????????

Changed in this revision

WiiClassicController.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
diff -r 000000000000 -r 3bcd6bc1d17e WiiClassicController.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WiiClassicController.lib	Thu Jun 16 03:41:29 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/kambara1415/code/WiiClassicController/#726fea07d08f
diff -r 000000000000 -r 3bcd6bc1d17e main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Jun 16 03:41:29 2016 +0000
@@ -0,0 +1,23 @@
+/*
+It is test code for WiiClassicController /Pro.
+*/
+
+#include "mbed.h"
+#include "WiiClassicController.h"
+
+Serial pc(USBTX, USBRX);
+WiiClassicController wii(p9, p10); // SDA , SCL
+
+int main()
+{
+ while(1){
+        pc.printf("----------------\n");
+        pc.printf("LX:%d\tLY:%d\n", wii.joy_LX(), wii.joy_LY());
+        pc.printf("RX:%d\tRY:%d\n", wii.joy_RX(), wii.joy_RY());
+        pc.printf("home:%d\t-:%d\t+:%d\n", wii.button_home(), wii.button_minus(), wii.button_plus());
+        pc.printf("L:%d\tR:%d\tZL:%d\tZR:%d\n", wii.button_L(), wii.button_R(), wii.button_ZL(), wii.button_ZR());
+        pc.printf("A:%d\tB:%d\tX:%d\tY:%d\n", wii.button_A(), wii.button_B(), wii.button_X(), wii.button_Y()); 
+        pc.printf("DU:%d\tDD:%d\tDL:%d\tDR:%d\n", wii.button_DU(), wii.button_DD(), wii.button_DL(), wii.button_DR()); 
+        wait(1);
+     } 
+}   
\ No newline at end of file
diff -r 000000000000 -r 3bcd6bc1d17e mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Jun 16 03:41:29 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34
\ No newline at end of file