New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

raspberrypi-button

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raspberrypi-button

Monitor button switch on Raspberry Pi

latest
Source
npmnpm
Version
1.5.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

raspberrypi-button

Overview

Monitor momentary push button switch on Raspberry Pi

Install

Be sure you have installed WiringPi python library on your Raspberry Pi.

sudo pip install wiringpi

Then install this module

npm i raspberrypi-button

Usage

This library is using WiringPi pin numerotation ! Simply instantiate a Button object specifying the pin number and the pullup mode (default false) into the constructor method. Then listen for the 'pressed', 'released' and/or 'changed' events on the Button object.

const Button = require('raspberrypi-button');

// Declare a button on pin 0
const button = new Button(0);

//Listen for events on the button
button.on('pressed', () => console.log('button is pressed'));
button.on('released', () => console.log('button is released'));
button.on('changed', (value) => console.log('button value is :', value));

Keywords

raspberrypi

FAQs

Package last updated on 06 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts