Monday, January 20, 2014

Using a Makey-Makey with Ubuntu

I've spent a lot of time working with software, but had never been exposed to the basic principles of electronics. The Makey-Makey is a great introduction to the world of circuitry. Its 'cool trick' is hacking just about anything into a keyboard. There's a lot of video of folks wiring all kinds of household items into input devices.

But underlying all the fun stuff is real first look at how electronic hardware works. The Sparkfun electronic hobbyist's site has an excellent collection of tutorials presenting the fundamental science and application of electronic circuitry.

Arduino is a very popular open-source electronics prototyping platform...your local RadioShack should offer a variety of Arduino-ready components. The Makey Makey is programmed using the Arduino IDE (Integrated Development Environment). Here's how to install the Arduino IDE in Ubuntu. (I used Arduino IDE version 1.0.5, and Ubuntu version 13.10.)

First, install the Arduino IDE. The one in the Ubuntu repository worked fine for me.
sudo apt-get install arduino
This will install the IDE software to: /usr/share/arduino/

To use the Arduino IDE with Makey-Makey, you'll need to install a driver. Download the zipped driver with:

 wget https://dlnmh9ip6v2uc.cloudfront.net/tutorialimages/MaKey_MaKey_QuickStart/MaKeyMaKey-13-8-12.zip

Then Unzip the driver to the IDE's hardware directory:
unzip MaKeyMaKey-13-8-12.zip -d /usr/share/arduino/hardware

If that worked properly, you should see the Makey-Makey listed in the Board menu.



To modify basic functionality of the Makey, you'll need to grab the source code.
Get and extract the source:
wget https://dlnmh9ip6v2uc.cloudfront.net/tutorialimages/MaKey_MaKey_QuickStart/MaKeyMaKey-13-8-12.zip  
Move it your home/sketchbook's
mv hardware/Makey ~/sketchbook/hardware/

Permissions

To ensure your IDE can communicate with the Makey, add your user to the following three groups, like so:
sudo usermod -a -G dialout $USER
sudo usermod -a -G tty $USER
sudo usermod -a -G uucp $USER

Resolve Ubuntu ModemManager conflicts

For the IDE to be able to update the Makey settings, you'll need edit ModemManager blacklist settings. (This fix is taken from discussions here and here.) Using your favorite text editor, you'll need to create/edit a file at:
sudo vi /etc/udev/rules.d/77-mm-arduino-blacklist.rules
In your editor, append the following line to that file:
ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="2b74", ENV{ID_MM_DEVICE_IGNORE}="1"
Save the file.

Unplug your Makey. Close the IDE, Logout/Login. Plug Makey back in. From there, you'll be ready to reprogram your Makey, following along with the MaKey MaKey Quickstart Guide (Part 2).

4 comments:

  1. You are my hero of the Day --> Reprogrammed the MakeyMakey in a jiffy on Linux Mint

    --> I used my regular Arduino Ide
    and followed the instructions on the Sparkfun website (as I ran into that first)
    --> then I added your little hack, the ModemManager blacklist settings

    Et voila

    YEAYY!!!

    thanks - generosity & good manuals are great!

    Wendy

    ReplyDelete
  2. The unzip command shouldn't include the /hardware suffix so it seems

    ReplyDelete
  3. I can't see my MM associated to a COM

    ReplyDelete