Skip to main content
The Nunchuk application reads data from a standard Wii Nunchuk controller connected over I2C. The joystick Y-axis controls the motor output level while the C and Z buttons provide secondary functions such as braking, cruise control, and reverse.

Hardware connection

The Nunchuk uses the I2C bus on the VESC. Wire it to the I2C pins on your hardware’s expansion header:
Original Nintendo Nunchuk controllers and most aftermarket clones work with this application. The firmware communicates over I2C at the standard Nunchuk address 0x52.

Control types

Button functions

The Nunchuk has two buttons, C (upper) and Z (lower trigger): Button state is exposed through the runtime API:

Configuration struct

Key parameters

Timeout

If no I2C data is received within LOCAL_TIMEOUT (2000 ms, defined in app_nunchuk.c), the output is cut. This protects against a disconnected cable during operation.

Runtime API