0.0.3 • Published 10 years ago

pi-pir-sensor v0.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

PIR sensor library for the Raspberry Pi

Build Status

Usage

var Sensor = require('pi-pir-sensor');
var sensor = new Sensor({
    // pin number must be specified
    pin: 12,

    // loop time to check PIR sensor, defaults to 1.5 seconds
    loop: 1500
});

sensor.on('movement', function () {
    // who's there?
});

sensor.start();

Methods


start()

Starts reading sensor

stop()

Stops reading sensor

Properties


pin

Pin number

loop

Loop interval

lastMovement

Date of last registered movement

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago