Wii nunchuk 3rd party compatible controller library (WiiChuk_compat) test
Dependencies: mbed WiiChuk_compat
Revision 0:7c98bcd8a245, committed 2011-03-14
- Comitter:
- gbrush
- Date:
- Mon Mar 14 23:48:15 2011 +0000
- Commit message:
- Initial
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WiiChuk_compat.lib Mon Mar 14 23:48:15 2011 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/gbrush/code/WiiChuk_compat/#e84a5ccbac19
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Mar 14 23:48:15 2011 +0000 @@ -0,0 +1,31 @@ +#include "mbed.h" + +#include "WiiChuk_compat.h" + +WiiChuck WiiNun(p9, p10); +Serial pc(USBTX, USBRX); + +int main() { + + + pc.baud(115200); + pc.printf("wii test begin \r\n"); + + int joyX = 0;int joyY = 0; + int accX = 0;int accY = 0;int accZ = 0; + int buttonC = 0;int buttonZ = 0; + + while(1) { + bool read = WiiNun.Read(&joyX,&joyY,&accX,&accY,&accZ,&buttonC,&buttonZ); + if(read) + { + pc.printf("x%3d y%3d c%1d z%1d --", joyX, joyY, buttonC, buttonZ); + pc.printf("x%d y%d z%d \r", accX, accY, accZ); + } + else + { + pc.printf("Error\n"); + } + wait(0.001); + } + }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Mar 14 23:48:15 2011 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912