UNPKG

rpio-l298n

Version:

Module to control an l298n motor controller on a Pi,dependencies rpio.

12 lines (11 loc) 260 B
const rpio = require('rpio'); function PinRead(pin) { this.pin = pin; rpio.open(pin,rpio.INPUT,rpio.LOW); } Object.assign(PinRead.prototype, { value : function () { return rpio.read(this.pin); } }); module.exports = PinRead;