Skip to content

This is a library for an ATTiny85 to use a Wii Nunchuk.

License

Notifications You must be signed in to change notification settings

datacute/TinyNunchuk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinyNunchuk

This is a library for an ATTiny85 to use a Wii Nunchuk, over I2C.

The Wii Nunchuk is a controller with a joystick, accelerometer, and two buttons. It communicates over I2C at 3.3V.

Example Usage

// Choose your I2C implementation before including TinyNunchuk.h
// The default if none is selected is Wire.h

// To use the Wire library:
//#include <Wire.h>

// To use the Adafruit's TinyWireM library:
//#include <TinyWireM.h>

// To use the TinyI2C library from https://github.com/technoblogy/tiny-i2c
//#include <TinyI2CMaster.h>

#include <TinyNunchuk.h>

void setup() {
  // Send the initialization sequence to the nunchuk.
  nunchuk.begin();
}

void loop() {
  nunchuk.update();

  // Nunchuk Joystick position:
  // nunchuk.x
  // nunchuk.y
  // Nunchuk Acceleration:
  // nunchuk.ax
  // nunchuk.ay
  // nunchuk.az
  // Nunchuk Button states:
  // nunchuk.c
  // nunchuk.z
}

About

This is a library for an ATTiny85 to use a Wii Nunchuk.

Resources

License

Stars

Watchers

Forks

Packages

No packages published