adafruit_nunchuk
¶
CircuitPython library for Nintendo Nunchuk controller
Author(s): Carter Nelson
Implementation Notes¶
Hardware:
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
- class adafruit_nunchuk.Nunchuk(i2c: I2C, address: int = 82, i2c_read_delay: float = 0.002)¶
Class which provides interface to Nintendo Nunchuk controller.
- Parameters:
i2c (~I2C) – The
busio.I2C
object to use.address (int) – (Optional) The I2C address of the device. Default is 0x52.
i2c_read_delay (float) – (Optional) The time in seconds to pause between the I2C write and read. This needs to be at least 200us. A conservative default of 2000us is used since some hosts may not be able to achieve such timing.
- property acceleration: Acceleration¶
The current accelerometer reading.
- property buttons: Buttons¶
The current pressed state of buttons C and Z.
- property joystick: Joystick¶
The current joystick position.
- property values: Values¶
The current state of all values.