If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.
You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!
The ButtonShield is an Arduino shield for keyboard input programmable through the Arduino IDE.
I always used my blackberry as the starting point of how I think about modular, open source hardware. It’s got a screen (some have a touchscreen), a motherboard, battery, wireless communication and buttons. Well, Touchscreen = TouchShield Slide , Motherboard = Arduino , Battery = Lithium Backpack , Wireless = Xbee , and…buttons with the Buttonshield. So here it is… it’s a shield built for the Arduino profile that has 32 buttons on it. It has a mode A or B selector, so you can wire up two of these directly to an Arduino, a lot like the InputShield , and still have pins for the TouchShield. And for everything you need to make your own “openberry”, check out the OpenBerry kit over here
The ButtonShield is a shield built for the Arduino profile that has 32 buttons on it. It has a mode A or B selector, so you can wire up two of these directly to an Arduino, a lot like the InputShield, and still have pins for the TouchShield display.
The ExtenderShield for Arduino modularity
Here is an example of how to mount the ButtonShield onto an Arduino using a DoubleWide ExtenderShield. The DoubleWide ExtenderShield allows the TouchShield Slide display, Lithium Backpack, and ButtonShield to be added to form a more complex Arduino gadget.
The ButtonShield occupies six Arduino digital pins. These pins report back the currently pressed key. The ButtonShield has a Lock button with LED, similar to a caps lock button. When the lock button is pressed, the key values change.
Return codes (lock key not pressed)
Return codes (lock key pressed)
The key value is the pin read as 6-bits, here's an example:
1 = 000001
2 = 000010
...
63 = 111111
Here's some sample code to use the ButtonShield on the Arduino.
Read the key press
This routine assumes you've previously set the mode to A or B. See setMode() for details.
int ButtonShield::readButtons() {
uint8_t button = 0;
for (uint8_t pin=0; pin<6; pin++) {
button |= digitalRead(pinList[pin]) << pin;
}
return button;
}
Change the mode
The mode control switch is on the backside of the shield.
Two ButtonShields could be mounted to a single Arduino by changing the occupied pins.
Mode A (pins: 4,5,6,7,18,19)
Mode B (pins: 8,9,10,11,16,17)
Flip the mode switch, then execute the following code.
Comments (0)
You don't have permission to comment on this page.