Wiichuck Finite State Machine

For this project, I decided to play with the nunchuck that comes with the Wii. The Wiichuck uses the I2C protocol, which is a common method of transmitting information. The Wiichuck provides many inputs with a built-in 3-axis accelerometer, 2-axis joystick, and two buttons.

I found the following site, which provided instructions on how to connect the nunchuck to the Arduino. I bought the connector shown on the site. The site also provides a small library for communicating with the Wiichuck.

This machine has 4 states:

  1. The LEDs are controlled by the orientation of the Wiichuck using the accelerometer. The brightness of the red LED is controlled by the position on the x-axis and the brightness of the green LED is controlled by the position on the y-axis.
  2. The LEDs are controlled by the position of the joystick on the Wiichuck. The brightness of the red LED is controlled by the x-position while the brightness of the green LED is controlled by the y-position.
  3. The LEDs are off. This state transitions only to state 1.
  4. The LEDs are off. This state transitions only to state 2.

[FSM diagram to come]

Arduino Sketch: FSM_WiichuckWithLED

IMG_7025

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: