PRT-12080

/*CheckKeyswillalwaysreturnthecurrentkeyinparamet
erk.
Thebooleanreturnvalueindicateswhetherthatvaluei
sdifferentthan
thepreviousvalue.
*/
if(keypad.checkKeys(k))
{
//Onlyprintwhenvaluehaschanged
Serial.print("Gotkey:");
Serial.println(k);
}
//Theresponsivenessofthekeypaddependsonhowfrequentl
yitischecked.
//50millisecondsseemstobeareasonablepollinterv
al.
delay(50);
}
Build and upload the sketch. Then open a serial terminal, and observe the
output while pressing buttons.
The Arduino recognizes keys based on the voltage produced by the VKey
The Arduino will print notifications as buttons are pressed and released. A
key number of 0 indicates that no keys are currently pressed.
If the Arduino isn’t properly tracking the key numbers, double-check that the
VKey object was declared with the proper analog pin and supply voltage
parameters. Also doublecheck that you’ve got the latest code from the
Github repository.
Resources And Going Further
The VKey is a great way to add up to 12 buttons to a project, while still
leaving many I/O pins for other tasks.
The schematics, PCB artwork and source code for the VKey are all found
on it’s Github page. For a deeper look at the internals of the VKey, check
the documents directory found there. You’ll find a more detailed theory of
operations document, with supporting SPICE simulations and
spreadsheets.
Github Repository
Modifications
There are a number of possible alterations that can be made to the VKey,
to tailor it to a specific application.
Different Switches
The VKey comes with 12 PTH pushbutton switches, but can support nearly
any normally-open SPST switch, such as arcade buttons or microswitches.
Page 7 of 8
Connect alternate switches across the left pair of pads
To connect other switches, connect them to the pair of pads on the left of
the tact switch footprint, as seen from the front of the board.
Voltage Source
While the VKey is primarily intended to interface with a microcontroller, that
doesn’t mean it can’t be used for other applications. The circuit is similar to
those used in analog synthesizers to extract a control voltage from the
piano keyboard. You could use the VKey to drive any device with a control
voltage input.
Page 8 of 8
8
/
5
/
201
6
https://learn.sparkfun.com/tutorials/vkey-voltag
e
-keypa
d
-hooku
p
-guide?_ga=1.43518693.1...

PRT-12080

Mfr. #:
Manufacturer:
SparkFun
Description:
Daughter Cards & OEM Boards Vkey Voltage Keypad Voltage Keypad
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet