loading

This project is a portable, Arduino-powered, grid-based MIDI controller that boots up into a variety of apps to do lots of things with sound. It has 16 backlit buttons, used as both inputs and outputs to give the controller some visual feedback. 2 potentiometers give analog control, depending on the app the pots are assigned to tempo, MIDI velocity, pitch, and scrolling (making the avaible grid space larger than 4x4). An x/y accelerometer and an x/y gyroscope add some playful, gestural control to the device; most of the apps implement a "shake to erase" control and several respond to tilt in various ways. It boots up into 7 different apps (described below), though it has the potential to boot up into 16 total. This device is primarily a MIDI controller, but I've also written an app that allows you to pull the button and analog data into MaxMSP and to control audio.

This controller was inspired by both the monome and tenori-on. When I was in college, I built a large touchscreen display, based on the Arduinome monome-Arduino clone schematics and code, that worked with all the open source monome applications written in MaxMSP. There are a ton of people building their own monome-type devices using these buttons from Sparkfun and the Arduinome code, as well as a few variations on the theme. With this project, I was interested in making a device that was a little more self-contained and relatively cheap to make (lots of buttons = lots of $). In keeping more with the concept of the tenori-on, this controller does all its app processing itself, it does not rely on a computer to process button presses/analog controls into MIDI. This means you can plug it directly into a synth or any device that understands MIDI and you're good to go, no computer required. It runs off a beefy LiPo battery that keeps it running for days on a charge, so it's fairly portable as well. In keeping with the monome side of things, it's totally open source and can be adapted to your particular audio setup/needs. All the Arduino code is up on github (click the cloud-shaped button to download), along with a MaxMSP patch that decodes data from the controller into something usable in Max.

An overview of the apps I've written so far:

Pixel Tilt - One pixel moves across a 2D keyboard with tilt, triggering MIDI as it moves. Control velocity and basenote with pots.

Flin - Music Box app based on monome. Speed and velocity of notes controlled by y tilt. Paging across 16 "lanes" with pot. Shake to erase.

Serial Communication with MaxMSP - Pull data from buttons and analog controls into MaxMSP and use Max to send LED states. Supports 5 bit analog controls for x/y accelerometer and 2 pots. This is great if you want to run audio processing applications with the controller. Download SerialDemo app (SerialDemo.maxpat, included with the Arduino files, click the cloud-shaped button here) to parse data in Max. Beat slicer (shown above) app is included with the Arduino files as well.

Arpeggiator - Plays a two, three, or four note arpeggio, similar to this app I wrote for monome. One pot controls the speed of the arpeggio, another controls velocity. Notes within the arpeggio can be shifted up or down by one semitone via button controls. The whole arpeggio is transposed via x tilt. Press the leftmost note in the arpeggio to play the notes in ascending order, press the rightmost note in the arpeggio to play the notes in descending order, and press a middle note in the arpeggio to play the notes in a random order. Shake to erase.

Boiing - Bouncing pixels that generate polyrhythms, based on this tenori-on app. Bounce direction based on y tilt. Speed and MIDI velocity (loudness) controlled by pots. Shake to erase.

Step Sequencer - Four note 16 step sequencer. Pots control tempo and paging across sequence. Shake to erase.

MIDI Keyboard - Simple MIDI keypad. Control velocity and basenote with pots, pitchbend with x tilt.

Parts List:

SPARKFUN:
(1x) Button Pad 4x4 - LED Compatible Sparkfun COM-07835
(1x) Button Pad 4x4 - Breakout PCB Sparkfun COM-08033
(1x) Arduino Uno Sparkfun DEV-11021
(1x) Accelerometer/Gyro 5 Degrees of Freedom Sparkfun SEN-11072

I put a 3-axis accelerometer and 2 axis gyroscope in this controller to give it some gestural control, but so far I haven't actually used the gyro in any apps, and I've only got the x and y axis of the accelerometer wired up. That means you could sub in a simpler/cheaper part like this. Update: this part is no longer available and I'm having a hard time finding an analog gyro to replace it. This analog accelerometer board will work, and as I said before, I haven't actually implemented any apps with the gyro yet, so it's not really necessary. the wiring is a little different for the new accelerometer, but if you connect x, y, z, gnd the way I've described in the rest of the schematics, and connect the 5V from the Arduino to the accelerometer's Vin, it should work the same.

DIGIKEY:
(16x) White 5mm LED (3mm is fine too) Digikey C513A-WSN-CV0Y0151-ND
(2x) 74HC595 shift register Digikey 296-1600-5-ND
(1x) 74HC165 shift register Digikey 296-8251-5-ND
(3x) 16 pin IC socket Digikey AE9992-ND

(16x) 1N4148 Diode Digikey 1N4148FS-ND
(4x) current limiting resistors (value will depend on LEDs, sample calculation included in step 5)
(4x) 10kOhm 1/4watt resistors Digikey CF14JT10K0CT-ND
(1x) 220Ohm 1/4watt resistor Digikey CF14JT220RCT-ND
(1x) 5-Pin MIDI Jack Digikey CP-7050-ND (optional - explained in step 27)
(1x) USB type B female jack Digikey 732-2734-ND (optional - explained in step 27)
(2x) 10kOhm linear taper potentiometer Digikey 987-1308-ND

(1x) Size N Panel-Mount Coaxial DC Power Jack with Switch Radioshack 274-1573 Update Digikey CP-002AHPJCT-ND this part may look different than the one pictured, check the datasheet/use a multimeter to be sure connection are correct.

(1x) SPST Toggle Switch Digikey 360-3289-ND

(1x) Size N Coaxial Power Plug Digikey CP3-1000-ND

JAMECO:
(1x) 16 conductor ribbon cable Jameco 28RC16-10VP
(1x) 16 pin right angle connector Jameco 746285-3
(6x) male header pins Jameco 103393

AMAZON:

(1x) Midi Cable Amazon (optional - explained in step 27)

(1x) Li-Ion 7.4V Tenergy 2200mAh Rechargeable Battery module with PCB Amazon
(1x) Tenergy Universal Smart Charger for Li-Ion/Polymer battery Pack (3.7V-14.8V 1-4 cells) Amazon
(1x) MIDI to USB cable Amazon (optional - explained in step 27)

MANY SUPPLIERS:
(2x) Knobs - the knobs I got are out of stock (from newark) as long as it fits a 0.25"/6.35mm shaft it will work, pick something you like:

https://www.tubesandmore.com/products/knobs

http://amzn.to/1RXew6a

ADDITIONAL MATERIALS:
22 Gauge Wire, various colors Jameco #9313-0-R
electrical tape Radioshack 64-2373
wire cutters
wire strippers
solder
wood/acrylic/project enclosure (I used this 6"x6"x2" bamboo box The Container Store)
glue/epoxy
double sided foam tape Amazon

Step 1: Schematic and Overview

All schematics for this project are shown above. Detailed overviews of the 74HC595, 74HC165, and power connections are given later in this Instructable. All the Arduino pin connections are listed below:

Analog

0 - Gyroscope Y (Y4.5)
1 - Potentiometer 1
2 - Gyroscope X (X4.5)
3 - Accelerometer Y (YAcc)
4 - Accelerometer X (XAcc)
5 - Potentiometer 2

Digital

0 - serial in - this must remain unconnected
1 - serial out - this is hooked up to the MIDI output
2 - 74HC165 data pin (Q7)
3 - 74HC165 clock pin (CP)
4 - 74HC165 latch pin (PL)
5 - 74HC595 clock pin (SH_CP)
6 - 74HC595 latch pin (ST_CP)
7 - 74HC595 data pin (DS)

no connections to digital pins 8-13

<p>hey...i want to know that which COM port of arduino should be connected to the beat slicer.</p><p>We are having a problem in producing beats using beat slicer with arduino.</p>
<p>in Max if you send a "bang" to the serial object and then look at what's printed it will tell you which port - a, b, c, d, e, etc You can set the port by clicking on the one of the buttons attached to the serial object.</p>
how do I do all that? I haven't used Max before.
<p>you'll have to look through the reference pages:</p><p>https://docs.cycling74.com/max5/refpages/max-ref/serial.html</p>
<p>So, Let me try and then let you know whether its working or not.</p><p>And one more, during steps 18-24 , after executing them my LED's are automatically on where has it should be operated by us by pressing the buttons.</p><p>So if you have any solutions regarding this problem, do let me know asap as I have to show this project working tomorrow in my university.</p>
<p>leds could be wired backwards? do they turn off when you would expect them to be on?</p>
I'm stuck at Testing LED's...<br><br>I checked all my wiring, all is as you wrote in the text for all steps so far. I checked continuity for any shorts, or bad bridges- all are good. The ribbon cable had good connection with both boards, i think the issue for me are the IC's that go into the sockets. I was not particularly conscious about ESD, they might be fried from some discharge. <br><br>If you don't mind, have a quick look at the pictures of my wiring and solder bridges. It may be hard to see some wires, but if you see anything fishy I can get better pictures of the area. I believe it's something I misinterpreted, or the fried IC's. If yo don't see any issues with my wiring, I'll go ahead and order new IC's for another (safer) attempt.
<p>edit- here's the pictures. Didn't upload from mobile for some reason.</p>
<p>the connections look fine. what are the symptoms? no leds are turning on? In my experience, the ics used to drive the leds are pretty robust, I haven't seen one get fried in normal circumstances - I'm not generally too careful about esd. Do you have an oscillascope to debug the output from the ics?</p>
I don't have an oscilloscope- I can find someone who does though. The LED's are not lighting up at all. <br><br>What should I look for on the oscilloscope if I get to testing it?
<p>ok, use a multimeter to check the voltage across the leds to see if they're even getting power. Are you sure the leds are installed in the correct orientation?</p>
<p>Your idea for checking voltage across the LED's was brilliant- they were barely getting anything- around 0.2v. It turns out, i had forgotten to attach the 5V/GND from the arduino to the IC's. </p><p>Needless to say, i'm very thankful for your help, it works great now. (I would recommend editing the step right before testing the LED's, when you say:</p><p>Pin connections:</p><p>74HC595 Arduino</p><p>data pin (pin 14) digital pin 7<br>latch pin (pin 12) digital pin 6<br>clock pin (pin 11) digital pin 5</p><p>I read past the full two sentences where it says to connect 5V/GND. I was confused by the &quot;Pin connections&quot; part, and thought those were the only added connections. Simply adding &quot;5V to 5V Arduino; GND to GND Arduino&quot; might help out in the future for others.</p><p>Working on getting the rest of it done, great instructable so far!</p>
<p>yeah at some point I think there was formatting to make that list more clear. I fixed it. glad to hear you solved it!</p>
<p>Is anyone else having trouble loading the code from Step 28? I get an error when verifying the tilting test for the two bottom pieces of code for lighting up pixels as you tilt the sensor.</p>
<p>what's the error?</p>
Thanks for the speedy reply! You are my hero. Here's the error for the middle piece of code when I try to copy and paste it from Step 28:<br><br>Arduino: 1.5.6-r2 (Windows 8), Board: &quot;Arduino Uno&quot;<br><br>sketch_sep12a.ino: In function 'void checkFirstButton()':<br>sketch_sep12a:170: error: expected `)' before '{' token<br>sketch_sep12a:207: error: expected primary-expression before '}' token<br>sketch_sep12a:207: error: expected `;' before '}' token<br>sketch_sep12a:209: error: a function-definition is not allowed here before '{' token<br>sketch_sep12a:379: error: expected `}' at end of input<br>sketch_sep12a:379: error: expected `}' at end of input<br>sketch_sep12a:379: error: expected `}' at end of input<br><br>And here's the error for the third piece of code:<br><br>Arduino: 1.5.6-r2 (Windows 8), Board: &quot;Arduino Uno&quot;<br><br>sketch_sep12a.ino: In function 'void shift()':<br>sketch_sep12a:191: error: expected primary-expression at end of input<br>sketch_sep12a:191: error: expected `;' at end of input<br>sketch_sep12a:191: error: expected `}' at end of input<br>sketch_sep12a:191: error: expected `}' at end of input<br>sketch_sep12a:191: error: expected `}' at end of input<br>sketch_sep12a:191: error: expected `}' at end of input<br>
<p>yeah I can see there's a bit of code missing there. I'll try to see if I can find the hard-drive that should be stored on. Those little bits of code along the way were all scrapped when I wrote the final code for the controller. So if you plan on using my final firmware (on github) everything should be fine. Does that work? </p>
<p>hey...i want to know that which COM port of arduino should be connected to the beat slicer.</p><p>We are having a problem in producing beats using beat slicer with arduino.</p>
<p>Hi Amanda! </p><p>Just wanted to thank you for this instructable, I learned so much while making it! It was my first time making something like this and it was quite daunting but I'm happy to say that everything works. :) </p><p>I just had a quick question about how you mounted all of the parts inside the box. I looked at Mads instructables to see how he did it for his devices but just wanted to ask, did you just put small pieces of wood and put in screws through the corners of the button pad+pcb? </p><p>Thanks again! This was a lot of fun to make. :)</p><p>-------</p><p>Also, just putting this out there in case it is useful, I haven't used a laser cutter before, so I ended up laser cutting the acrylic with the eps file Amanda provided through Ponoko. Since it was fairly simple to laser cut it ended up being free (at time of writing they let you laser cut your first project for free) :D </p>
<p>Hi! Glad to hear it works. I never really properly mounted everything in the project box, I've been meaning to do that, right now the front panel is just press fits into the top of the box. One way that might be cool is to mount the electronics on the inside of the box with some support behind the button pad pcb so you have something to press against when you hit the buttons. Then epoxy some magnets on the inside corners of the box and the underside of the front panel so it snaps into place, but you can still open it up easily if you need. </p><p>Would love to see a pic of the final product! How did you end up mounting the usb output in the box?</p>
<p>Wow, I'm definitely working on an implementation of this controller for a guitar. I already have a wireless MIDI module that I can power off the battery on this design. </p><p>The question is... do you think I could have its onboard sequencer sync to Midi Clock? Say I have an Arduino down the line where I can pick up Midi Clock, could the Arduino send via RF Midi Clock to the SugarCube to get it to sync?</p><p>Is there a simpler idea?</p>
<p>Does anyone happen to have a PCB design of this already? Fritzing/Eagle/DipTrace? If not, im in the process of making one as i wouldnt mind making some additional changes and making these over and over with perfboard gets really time consuming =-)</p>
<p>nice! let me know how that goes, it might make sense for me to eventually move documentation over to a wiki if there's interest in doing mods and stuff. Have you successfully finished a perfboard version yet?</p>
Yep! It took me a few tries because I'm apparently terrible at those solder bridges but I eventually got it. I'm in the process of printing a prototype shield so once I verify it's good I'll post up the schematic and pcb design :-)
<p>I really like it.. Well done</p>
<p>Really mind blowing</p>
<p>This is amazing</p>
<p>Fantastic, it works beautifully</p>
<p>Hi Amanda is there a way to adapt the button test code to print the button presses straight to the serial monitor. im trying to encorporate part of the code into a bigger patch. </p>
<p>My version of a Arduino SugarCube based on this instructable. Mine has 4 pots, no gyroscope, no accelerometer, no battery power, just a MIDI controller for my project studio. I edited all the code to suit my own basic needs, uploaded the firmware and everything it works great! Thanks Amanda! :)</p>
<p>hi i have completed this build but am getting this error when uploading the final code.</p><p><br>This report would have more information with</p><p> &quot;Show verbose output during compilation&quot;</p><p> enabled in File &gt; Preferences.</p><p>Arduino: 1.0.6 (Mac OS X), Board: &quot;Arduino Uno&quot;</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:13: multiple definition of `SugarCube::SugarCube()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:13: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:13: multiple definition of `SugarCube::SugarCube()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:13: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::timer1Setup()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:77: multiple definition of `SugarCube::timer1Setup()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:77: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::timer2Setup()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:99: multiple definition of `SugarCube::timer2Setup()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:99: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setDefaultPinConnections()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:121: multiple definition of `SugarCube::setDefaultPinConnections()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:121: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setLedLatchPin(unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:137: multiple definition of `SugarCube::setLedLatchPin(unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:137: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setLedClockPin(unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:144: multiple definition of `SugarCube::setLedClockPin(unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:144: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setLedDataPin(unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:149: multiple definition of `SugarCube::setLedDataPin(unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:149: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setButtonLatchPin(unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:154: multiple definition of `SugarCube::setButtonLatchPin(unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:154: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setButtonClockPin(unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:159: multiple definition of `SugarCube::setButtonClockPin(unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:159: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setButtonDataPin(unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:164: multiple definition of `SugarCube::setButtonDataPin(unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:164: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setXAccPin(unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:169: multiple definition of `SugarCube::setXAccPin(unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:169: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setYAccPin(unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:174: multiple definition of `SugarCube::setYAccPin(unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:174: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setPot1Pin(unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:179: multiple definition of `SugarCube::setPot1Pin(unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:179: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setPot2Pin(unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:184: multiple definition of `SugarCube::setPot2Pin(unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:184: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setXGyroPin(unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:189: multiple definition of `SugarCube::setXGyroPin(unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:189: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setYGyroPin(unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:194: multiple definition of `SugarCube::setYGyroPin(unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:194: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::getStateOfButton(unsigned char, unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:239: multiple definition of `SugarCube::getStateOfButton(unsigned char, unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:239: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::getStateOfButtonRow(unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:247: multiple definition of `SugarCube::getStateOfButtonRow(unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:247: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::getXAxisGyroVal()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:321: multiple definition of `SugarCube::getXAxisGyroVal()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:321: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::getYAxisGyroVal()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:326: multiple definition of `SugarCube::getYAxisGyroVal()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:326: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::getPot1Val()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:331: multiple definition of `SugarCube::getPot1Val()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:331: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::getPot2Val()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:336: multiple definition of `SugarCube::getPot2Val()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:336: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::turnOnLED(unsigned char, unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:347: multiple definition of `SugarCube::turnOnLED(unsigned char, unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:347: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::turnOffLED(unsigned char, unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:352: multiple definition of `SugarCube::turnOffLED(unsigned char, unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:352: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setLEDState(unsigned char, unsigned char, unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:355: multiple definition of `SugarCube::setLEDState(unsigned char, unsigned char, unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:355: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setLEDsByArray(unsigned char*)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:364: multiple definition of `SugarCube::setLEDsByArray(unsigned char*)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:364: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setLEDRow(unsigned char, unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:397: multiple definition of `SugarCube::setLEDRow(unsigned char, unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:397: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::turnOnLED(unsigned char, unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:402: multiple definition of `SugarCube::setLEDCol(unsigned char, unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:402: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::clearLEDs()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:410: multiple definition of `SugarCube::clearLEDs()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:410: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::buttonCheck(unsigned char, unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:494: multiple definition of `SugarCube::buttonCheck(unsigned char, unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:494: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setXGyro(int)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:583: multiple definition of `SugarCube::setXGyro(int)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:583: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setYGyro(int)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:591: multiple definition of `SugarCube::setYGyro(int)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:591: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setPot1(int)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:599: multiple definition of `SugarCube::setPot1(int)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:599: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setPot2(int)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:607: multiple definition of `SugarCube::setPot2(int)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:607: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::checkForShake()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:615: multiple definition of `SugarCube::checkForShake()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:615: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setDelegate(Delegate*)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:727: multiple definition of `SugarCube::setDelegate(Delegate*)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:727: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::timer2Routine()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:704: multiple definition of `SugarCube::timer2Routine()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:704: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setupSerialCommunication()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:679: multiple definition of `SugarCube::setupSerialCommunication()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:679: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setupMIDICommunication()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:645: multiple definition of `SugarCube::setupMIDICommunication()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:645: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::sendMIDI(unsigned char, unsigned char, unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:666: multiple definition of `SugarCube::sendMIDI(unsigned char, unsigned char, unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:666: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::pitchBend(unsigned char, unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:661: multiple definition of `SugarCube::pitchBend(unsigned char, unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:661: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::noteOff(unsigned char, unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:656: multiple definition of `SugarCube::noteOff(unsigned char, unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:656: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::noteOn(unsigned char, unsigned char, unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:651: multiple definition of `SugarCube::noteOn(unsigned char, unsigned char, unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:651: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::scaleAcc(int)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:577: multiple definition of `SugarCube::scaleAcc(int)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:577: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setYAcc(int)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:566: multiple definition of `SugarCube::setYAcc(int)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:566: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setXAcc(int)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:555: multiple definition of `SugarCube::setXAcc(int)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:555: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::getYAxisAccVal()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:316: multiple definition of `SugarCube::getYAxisAccVal()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:316: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::getXAxisAccVal()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:311: multiple definition of `SugarCube::getXAxisAccVal()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:311: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::analogValFromPin(unsigned char, int)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:546: multiple definition of `SugarCube::analogValFromPin(unsigned char, int)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:546: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::checkAnalogPins()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:535: multiple definition of `SugarCube::checkAnalogPins()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:535: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::initAnalogPins()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:525: multiple definition of `SugarCube::initAnalogPins()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:525: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setLEDsByBitmap(unsigned char*, unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:377: multiple definition of `SugarCube::setLEDsByBitmap(unsigned char*, unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:377: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::numPressedButtons(unsigned char*)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:283: multiple definition of `SugarCube::numPressedButtons(unsigned char*)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:283: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::getPressedButtons(unsigned char (*) [2])':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:265: multiple definition of `SugarCube::getPressedButtons(unsigned char (*) [2])'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:265: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::getStateOfButtonCol(unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:252: multiple definition of `SugarCube::getStateOfButtonCol(unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:252: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::shift(unsigned char)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:421: multiple definition of `SugarCube::shift(unsigned char)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:421: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::timer1Routine()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:690: multiple definition of `SugarCube::timer1Routine()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:690: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::getButtonStatesBitmap(unsigned char, unsigned char*)':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:217: multiple definition of `SugarCube::getButtonStatesBitmap(unsigned char, unsigned char*)'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:217: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::getButtonStatesArray(unsigned char (*) [4])':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:201: multiple definition of `SugarCube::getButtonStatesArray(unsigned char (*) [4])'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:201: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::setupInputsAndOutputs()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:55: multiple definition of `SugarCube::setupInputsAndOutputs()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:55: first defined here</p><p>sugarcube/SugarCube.cpp.o: In function `SugarCube::init()':</p><p>/Users/kierondeane/Documents/Arduino/libraries/sugarcube/SugarCube.cpp:39: multiple definition of `SugarCube::init()'</p><p>sketch_feb23a.cpp.o:/Applications/sketch_feb23a.ino:39: first defined here</p><p>core.a(main.cpp.o): In function `main':</p><p>/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/main.cpp:40: undefined reference to `setup'</p><p>/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/main.cpp:43: undefined reference to `loop'</p><p><br>any help would be greatly appreciated</p>
<p>maybe try a fresh download? what version of arduino are you using?</p>
<p>im using the newest version of the arduino ide and arduino uno. all test codes such as buttons and led test code works the rest get this same error</p>
<p>I think maybe you put the folder in Arduino/libraries? you don't actually have to do that, you can just download the zip from github, unzip, change the folder name to "SugarCubeLibraryFiles" and then open the SugarCubeLibraryFiles.ino file inside.</p><p>I tested it on the latest version of arduino, should work. Jut make sure you have the right board selected.</p><p>Sorry if that was confusing!</p>
<p>Hello again! :) Had to take a long break from this due to other school work keeping me busy. Ok, I re-read steps 19-24 with your updated notes taken into account. The &quot;Test Buttons&quot; arduino code when run on my build results in the following inverted behavior: all the LEDs are lit up after uploading the code and while pressing a button each LED momentarily turns off (i.e. when pressed) and is lit back up after release of button. I don't know why this is and I have allegedly checked all my other connections to the best of my ability that is.... :( P.S. Note, Step 18: Test LEDs code is working as it should = OK. I went all the way back to re-trace the steps 1 thru 24 documentation to see what I might have done wrong.</p>
<p>did you work this out? sounds like the leds are fine but something is up with the button wiring. Are the diodes in the right direction?</p>
<p>Does are in the right direction, yes. Still having this issue, and yes something is wrong with the button wiring. any suggestions?</p>
<p>are the pull down resistors there? can you attach a clear pic of what you've got? and you're running the code from step 24?</p>
<p>Yes, running the code from step 24. All the buttons respond (more or less) there is just inverted operation of the buttons compared to that of your implementation (is really the only difference I can tell). Here are some more pics.<br><br>Note, I burned some of the traces from the PCB board so I had to create a jump lead for one of the 8 group of header pins that connect to the ribbon clamp.<br><br>I fear the only thing there is left to do is to re-do the 8 header pins and resistors because they are a mess. As you mentioned to me a while ago, the DIPs are pretty resilient and should be okay so I keep looking at the 8 header pins as the source of this glitch.<br><br>The discoloration of the solder came from earlier cleaning during troubleshooting because I didn't use distilled water (I think). Disregard the scratches, I used a stanley knife to make sure none of the globbed solder points were touching each other on the edges.<br><br>Also note, I do have a protoboard in case it might help to re-build a sub-circuit or two on that first before going back to soldering again. Also, I'm getting a new solder because the one a bought is too hot and cannot be adjusted.<br><br>Any help would be greatly appreciated. I just hope I don't have to start from scratch because this project was expensive.</p>
<p>Do you have a multimeter? what's the voltage at the swt-gnd pins when no buttons are pressed?</p>
<p>I got 4.904 Volts when no buttons are pressed, I measured from the 5V arduino pin with the red probe to the swt-gin pins (pull down resistors going to arduino gnd) with the black probe. Those are points.</p><p>Could you perhaps give me an example value of what I should be getting and a point in the circuit unrelated to my problem. This would give me more confidence in my measurements. Thanks! :)</p>
<p>Update, I completely rebuilt the header pin section with all the resistors and everything for the ribbon cable that goes to the Sparkfun buttonPad. Still same result, &quot;Test LED&quot; code works perfectly but inverted behavior of the Buttons (they are all light up as soon as I upload your &quot;Test Buttons&quot; code and if I press the button the led shuts off when pressed &amp; lights back up as soon as button is released). Should I check anything with the digital pins at the arduino or the HC195 connections?</p>
<p>and I tested the buttons with the pushbutton mini circuit and code that is lighting up the LED 13 embedded on the Arduino board. Result = all OK :)</p><p>After doing more research, the pull down resistors are behaving like pull up resistors on the switches but I just need help or need to do more research on the pins of the shift registers and arduino digital pins in order to finally isolate the problem.</p>
<p>Victory! :) I finally figured it out! On my own, which is obviously the most rewarding way! Anyone else reading this &amp; waiting for a reply from Amanda it might take a while because she went back to school and her studies are taking up a lot of her time and if I understand it correctly she no longer works at Instructables... source re: her website.</p>
<p>great! sorry I couldn't help more what was the problem? Should I change something in the instructable?</p>
<p>No worries at all, I think your instructable is fine. This was my mistake all along. At the header pins I dragged the solder over too much over the pull down resistors (for the l.e.d GND) and then proceeded to make a carbon copy of the same mistake when I rebuilt the header pins on solder and retry. To troubleshoot, I rebuilt the entire circuit on breadboard to be able to make fast changes and disconnect pins at will. Now, I just have to manage to re-solder correctly without burning off any traces otherwise I have to re-do the header pin section one more time (no biggie, whatever it takes). Thanks Amanda for the help thus far, I think soon I will be able to complete the project and your help has been appreciated along the way. Cheers for that and congrats on getting into MIT (I read this on your website or somewhere it was written I'm pretty sure). :)</p>
<p>thanks! keep me posted on your build</p>
<p>I've gotten an adafruit trellis button pad and controller (<a href="https://learn.adafruit.com/adafruit-trellis-diy-open-source-led-keypad/overview" rel="nofollow">https://learn.adafruit.com/adafruit-trellis-diy-open-source-led-keypad/overview</a>) which interfaces with the arduino through an on board chip multiplexer, communicating through the i2c protocol. How would I go about converting the sugarcube firmware to work with the adafruit trellis? Is it possible? My coding skills are pretty weak so any help is greatly appreciated.</p><p>Thanks</p>
<p>you could adapt this to work with the trellis, but you'll have to do a fair amount of coding to get it to work with i2c</p>
<p>When I connect to my computer through the Arduino USB port, I am able to see it in the serial port drop down in Hairless and am able to control MIDI sounds in FL studio but when I connect through the USB of the MIDI to USB cable, I get the message USB not recognized and it does not appear in Hairless. I tested the cable prior to taking it apart and it worked fine. Do you know what could be causing this discrepancy from Arduino USB port and MIDI to USB cable USB port?</p>

About This Instructable

92,252views

640favorites

License:

Bio: I'm a grad student at the Center for Bits and Atoms at MIT Media Lab. Before that I worked at Instructables, writing code for ... More »
More by amandaghassaei:OTCA Metapixel - Conway's Game of Life "9 Degrees of Freedom" IMU Twitter Controlled Pet Feeder 
Add instructable to: