Teensy and Wii Chucks
Back at EM2013 , I acquired a Teensy 3.0 micro-controller and two Wii NunChuck controllers (pictured above) courtesy of Gordon Good. It’s a nice collection of gadgets. Gordon asked participants to make a blog post about their Teensy adventures in return for these items, so this is my attempt to get started and make good on that promise.
Gordon’s original Teensy project was a demonstration of how to use the Nunchuck as a MIDI controller for Garageband or Ableton Live. Specifically, it used the accelerometer to trigger notes, and the buttons to move up and down a scale to change the note that is triggered.
Since EM2013, I returned to this project only briefly to demo the concept for my electro meetup. I want to better understand what the code does. In the original demo, the joystick on the NunChuck was not utilized, so I think exploring that is going to be a good exercise, and will put some of my Processing course to work.
My first task was to return to the original project and make sure it worked with my current configuration. I already had the Arduino IDE, but soon found the version was not current, and this conflicted with the Teensy installer. (Of course it was only after some error messages and head-scratching that I realized this, and Gordon kindly responded to my call for help).
Once Teensy is installed, you need to change some settings in the Arduino IDE – and you’ll need to remember to put these back if you go back to your Arduino projects.
Once the environment was good to go, I still had another hurdle with this error:
ChuckDrums.ino:2:20: fatal error: i2c_t3.h: No such file or directory
Gordon explained that he “was using a user-contributed i2c library that enabled switching between the two sets of i2c pins on the Teensy” and referred me to this thread. Equipped with v6 of the i2c_t3 library, code loaded into the Teensy just fine.
Another very important thing is to make sure that you connect the Nunchuck’s in the correct orientation. Speaking from experience, this is one of the dumbest time-wasting newbie mistakes that will drive you crazy. Here’s the correct orientation:
During our EM2013 workshop we used Garageband, but I prefer to use Ableton Live as that is my primary DAW, so here is another important piece of setup:
Flickr still doesn’t have a good HTML5 embed option, so you’ll need to go directly to my Flickr page to see some videos relating to this project.
Gordon’s project page regarding Ableton Live scene control.
Another Nunchuck library: