Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: WiiChuck.h
- Revision:
- 0:f442b7eb68b0
- Child:
- 1:f04b559e06b3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WiiChuck.h Sun Dec 12 21:07:19 2010 +0000 @@ -0,0 +1,31 @@ +#ifndef __WIICHUCK_H +#define __WIICHUCK_H + +#include "mbed.h" + +#define NUNCHUCK_ADDR 0xA4 // 0x52 << 1 +#define NUNCHUCK_REGADDR 0x40 // +#define NUNCHUCK_READLEN 0x06 // +#define I2C_ACK 0 +#define I2C_READ_DELAY 0.01 + +#define Joy_X 0 +#define Joy_Y 1 +#define Acc_X 2 +#define Acc_Y 3 +#define Acc_Z 4 +#define Button 5 + +class WiiChuck { +public: + bool Error; + WiiChuck(PinName data, PinName clk); + bool Read(int* joyX,int* joyY,int* accX,int* accY,int* accZ,int* buttonC,int* buttonZ); + +private: + I2C _i2c; + + +}; + +#endif \ No newline at end of file