Arduino library to control Wii Remote expansion devices.
- Provide an interface to use Wii Remote expansion devices such as :
- Nunchuks;
- Classic Controlers.
Download this repository and unzip it into the Arduino libraries folder on your computer. You should rename the folder WiiExpansions-master
in WiiExpansions
.
Wii Remote expansion devices use I2C as transportation protocol. Simply connect it to Arduino through A4 (SDA) and A5 (CLK) pins :
#include <WiiExpansions.h>
// WiiNunchuk instance creation
WiiNunchuk nunchuck;
void setup() {
// Nunchuck initialization
nunchuck.init();
}
void loop() {
// nunchuck update
nunchuck.read();
if(nunchuck.A.isPressed()){
// do something when the button A is pressed
}
}
If you'd like to contribute, please raise an issue or fork the repository and use a feature branch. Pull requests are warmly welcome.
The code in this project is licensed under MIT license. See the LICENCE file for details.
- Julien Lebunetel - jlebunetel