Wednesday, June 10, 2009

Live footage of the ButtonShield in the wild

Here's a little video of the finished ButtonShield in action. This video shows me pressing the buttons one by one, and showing what the shift key looks like. This is the quick version:

Of course, here's the source code that runs on the Arduino - it's very simple, to keep the interface at a bare minimum. That way, the Arduino doesn't have to constantly poll each of the buttons one by one - the ButtonShield takes care of all of that, and just sends back its values.

#include < ButtonShield.h >

ButtonShield buttonsA = ButtonShield(0); /* Created a new ButtonShield on Mode A */
ButtonShield buttonsB = ButtonShield(1); /* Created a new ButtonShield on Mode A */

void setup() {

void loop() {
Serial.print("ModeA: ");
Serial.print(" ModeB: ");

Each board has a built-in set of "firmware" that takes care of polling the buttons, and abstracts a lot of the really annoying parts of dealing with 36 buttons and 2 modes (thanks Chris for helping me on that part).

And this is the (really) long version of pretty much the same thing, except it also shows a little more detail on getting the shield up and running:

Oh, by the way, you can't really see it in the video, but there's also a single high-brightness white LED on the backside of the shield, which serves a little as a "backlight". Of course it it's too annoying, there's an SPDT switch on the backside that toggles the backlight on and off :-)


1 comment:

merlin13 said...

Thanks for all the posts about you making and using the Button Shield - the shield looks awesome. I wish I had a project in mind to justify my getting one - soon, I hope :-)