1.0.3 • Published 4 years ago

rpi-keypad v1.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

rpi-keypad

a simple matrix keypad library for the raspberry pi

installation

npm i rpi-keypad

sample usage

typescript usage

import Keypad from "rpi-keypad";

javascript usage

var Keypad = require("rpi-keypad");

var input = new Keypad(
    [
        ["1", "2", "3", "A"],
        ["4", "5", "6", "B"],
        ["7", "8", "9", "C"],
        ["*", "0", "#", "D"],
    ],                // keypad layout
    [40, 38, 36, 32], // row GPIO pins
    [37, 35, 33, 31]  // colum GPIO pins
);
    
setInterval(() => {
    var key = keypad.getKey();
    if (key != null){
        console.log("key pressed: " + key);
    } else {
        console.log("no key pressed");
    }
}, 100);
1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago