Since my last post about the glockenspiel, I’ve been taking a vacation from my vacation (aka working). Today I turned back to the glockenspiel and wired up the first of the 5 lighted switches.
The hardware is lighted buttons from Sparkfun in various colors, some 4-wire phone cable I bought years ago, and 4-conductor 0.1″ connectors. The heat-shrink tubing keeps the 5 pins of the button from shorting to each other. Two wires run the LED, and the other three make up the button (common, normally open, and the unused normally closed).
I had a little trouble reading the switch: whatever I did, the output was close to ground. After much experimentation, I realized that the pin I was using (pin 52) is used on the Arduino Mega 2560 for part of the SPI bus. Once I moved the input to an unused pin, it worked like a charm, with the internal pull-up resistor to keep the parts count nicely low.
Next I improve the clanking sound with silicone.