1.0.8 • Published 12 months ago

pigpio-button v1.0.8

Weekly downloads
1
License
ISC
Repository
github
Last release
12 months ago

pigpio-button

Button using npm module pigpio.

Installation

$ npm install pigpio-button --save

Usage

var Button = require('pigpio-button');

// Construct a new button. See source code for more options.
var button = new Button({pin:19});

button.on('click', (clicks, time) => {

    // clicks - number of clicks
    // time   - milliseconds since last button press

    if (clicks == 1) {
        if (time < 1000)
            console.log('Single click.');
        else
            console.log('Single long click.');
    }
    else {
        console.log('Double click (or more)');

    }
});
1.0.8

12 months ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago