# inputmonitor

> An Input Monitor for GPIOs on Raspberry PI with Node.js using pigpio

Latest version **1.0.21** (published 2018-07-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install inputmonitor
pnpm add inputmonitor
yarn add inputmonitor
bun add inputmonitor
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.21 |
| Published | 2018-07-04 |
| First published | 2017-02-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | rafaelquines |
| Maintainers | rafaelquines |
| Keywords | raspberry, input, monitor, gpio |

## Links

- npm: https://www.npmjs.com/package/inputmonitor
- Repository: https://github.com/rafaelquines/inputmonitor
- Homepage: https://github.com/rafaelquines/inputmonitor#readme
- Issues: https://github.com/rafaelquines/inputmonitor/issues
- npm.io page: https://npm.io/package/inputmonitor

## Dependencies (3)

- [pigpio](https://npm.io/package/pigpio.md) ^1.1.0
- [detect-rpi](https://npm.io/package/detect-rpi.md) ^1.3.0
- [@rafaelquines/pigpio-mock](https://npm.io/package/@rafaelquines/pigpio-mock.md) 0.0.2

## Recent versions

- 1.0.21 (latest) — 2018-07-04
- 1.0.20 — 2018-07-04
- 1.0.19 — 2018-02-17
- 1.0.18 — 2018-02-07
- 1.0.17 — 2018-02-03
- 1.0.16 — 2018-01-26
- 1.0.15 — 2017-11-01
- 1.0.14 — 2017-11-01
- 1.0.13 — 2017-11-01
- 1.0.12 — 2017-10-31
- 1.0.11 — 2017-10-31
- 1.0.10 — 2017-07-03
- 1.0.9 — 2017-07-03
- 1.0.8 — 2017-07-03
- 1.0.7 — 2017-07-03
- … 7 more at https://npm.io/package/inputmonitor/versions

## README

# inputmonitor
An Input Monitor for GPIOs on Raspberry PI with Node.js using pigpio

## Basic Usage

```javascript
"use strict";
var Gpio = require('pigpio').Gpio;
var InputMonitor = require('inputmonitor');

// Define constants
var gpioNum = 19;
var inputName = 'Input1';
var inputNum = 1;

// Function to get input status changed
function inputStatusChanged(number, name, value) {
    console.log(name + '[' + number + '] (' + (value ? 'ACTIVED' : 'DEACTIVED') + ')');
}

// Initialize InputMonitor with GPIO number, a number, a name
var inputMonitor = new InputMonitor(gpioNum, Gpio.PUD_DOWN, inputNum, inputName);

// Set funcion callback
inputMonitor.onInputChange(inputStatusChanged);

// Start watch
inputMonitor.start();

```

---
_Source: https://npm.io/package/inputmonitor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
