Generalized adaptation of the WiiChuk_compat library.
Fork of WiiChuk_compat by
Diff: WiiChuck.h
- Revision:
- 4:e39bbb89c4e9
- Parent:
- 3:fcc2f24d0644
- Child:
- 5:be9ce129de7c
--- a/WiiChuck.h Sat Dec 20 21:45:03 2014 +0000 +++ b/WiiChuck.h Sun Dec 21 18:24:50 2014 +0000 @@ -74,6 +74,27 @@ /** * Class for interfacing with a Wii Nunchuck (including knock offs) + * + * Example: + * @code + * // Continuously read data from the nunchuck + * #include "mbed.h" + * #include "WiiChuck.h" + * + * WiiChuck nunchuck(PB_9, PB_8); + * + * int main() { + * nunchuck_data_t nunchuckData; + * + * printf("joyX\tjoyY\taccX\taccY\taccZ\tbuttC\tbuttD\r\n"); + * while(1) { + * nunchuck.read(&nunchuckData); + * printf("%d\t%d\t%d\t%d\t%d\t%s\t%s\r\n", + * nunchuckData.joyX, nunchuckData.joyY, nunchuckData.accX, nunchuckData.accY, + * nunchuckData.accZ, nunchuckData.buttonC ? "X" : "", nunchuckData.buttonZ ? "X" : ""); + * } + * } + * @endcode */ class WiiChuck { public: