wiring-pi-pwm
v1.0.1
Published
Bindings to wiringPi banana pi
Downloads
14
Maintainers
Readme
UPDATE
Node.js bindings to WiringPi
Install
> npm install wiring-pi-pwm
Use
var wpi = require('wiring-pi-pwm');
wpi.setup([mode])
wpi.setup();
wpi.setup('gpio');
Valid Modes:
wpi
: sets up pin numbering withwiringPiSetup
gpio
: sets up pin numbers withwiringPiSetupGpio
sys
: sets up pin numbers withwiringPiSetupSys
See WiringPi Pins for the differences in Pin numbering;
wpi.pinMode(pin, mode)
wpi.pinMode(0, wpi.modes.OUTPUT);
pin
: pin numbermode
:wpi.modes.INPUT
,wpi.modes.OUTPUT
, orwpi.modes.PWM_OUTPUT
wpi.digitalWrite(pin, value)
wpi.digitalWrite(0, wpi.HIGH);
wpi.digitalWrite(0, wpi.LOW);
pin
: pin numbervalue
: 0 (wpi.LOW
) or 1 (wpi.HIGH
)
wpi.digitalRead(pin)
wpi.digitalRead(0);
//=> 1
pin
: pin number
Wrapped WiringPI calls:
These have the same arguments as their WiringPi counterparts
piBoardRev
pwmSetRange
pwmSetClock
pwmWrite