Skip to content
Pawel Szymczykowski edited this page Nov 20, 2015 · 29 revisions

The Keypad class constructs an object that represents a single Keypad attached to the board.

Supported Keypads:

Parameters

  • General Options

    Property Type Value/Description Default Required
    controller string AT42QT1070, MPR121, MPR121QR2, QTOUCH, VKEY, ANALOG. The Name of the controller to use ANALOG Yes
    keys array Mapping of key values By Device No
  • VKEY Options (controller: "VKEY")

    Property Type Value/Description Default Required
    pin number, string Analog pin Yes
  • ANALOG Options (controller: "ANALOG")

    Property Type Value/Description Default Required
    pin number, string Analog pin Yes
    length number Number of keys (required only if keys is not specified) Yes

Shape

Property Name Description Read Only
which Value of key pressed from keys array No
timestamp Timestamp at time of key press No

Component Initialization

ANALOG

new five.Keypad({
  pin: "A0",
  length: 16
});

VKEY

new five.Keypad({
  controller: "VKEY",
  pin: "A0",
});

MPR121

new five.Keypad({
   controller: "MPR121",
   keys: ["!", "@", "#", "$", "%", "^", "&", "-", "+", "_", "=", ":"]
});

MPR121QR2

new five.Keypad({
   controller: "MPR121QR2"
});

QTOUCH / AT42QT1070

new five.Keypad({
  controller: "QTOUCH", // or "AT42QT1070"
});

Events

  • hold The key has been held for holdtime milliseconds

  • down, press The key has been pressed.

  • up, release The key has been released.

Examples

Clone this wiki locally