GY-63_MS5611/libraries/AnalogKeypad
2020-11-27 11:10:47 +01:00
..
examples/analogKeypad first stable for (Robotdyn) 4x4 analog keypad 2019-02-01 15:18:01 +01:00
AnalogKeypad.cpp update libraries A-D 2020-11-27 11:10:47 +01:00
AnalogKeypad.h update libraries A-D 2020-11-27 11:10:47 +01:00
keywords.txt update libraries A-D 2020-11-27 11:10:47 +01:00
library.json update libraries A-D 2020-11-27 11:10:47 +01:00
library.properties update libraries A-D 2020-11-27 11:10:47 +01:00
LICENSE update libraries A-D 2020-11-27 11:10:47 +01:00
README.md update libraries A-D 2020-11-27 11:10:47 +01:00

AnalogKeypad

Library for (Robotdyn) 4x4 and 4x3 analog keypad

Description

AnalogKeypad is a simple library to read the keys from a (robotdyn) 4x4 or 4x3 keypad. No other keypads are tested, but they should work with this library after adjusting the MAGIC NUMBERS in the function rawRead().

Operation

The simplest usage is to use the read() function. This will return a 0 (NOKEY) when no key is pressed and a number 1 to 16 for the keys pressed. Note the return value may fluctuate randomly when multiple keys are pressed.

The pressed() function is a bit more robust. It returns the key pressed first, so multiple key presses simultaniously are less likely to disturbe your program.

The event() function checks if an event has happened. The events are:

  • PRESSED 0x80
  • RELEASED 0x40
  • REPEATED 0x20
  • CHANGED 0x10

key() can be called to check the last key involved.