Push dev work to master #2

Merged
sixteenmillimeter merged 416 commits from dev into master 2018-07-19 15:29:02 +00:00
1 changed files with 34 additions and 1 deletions
Showing only changes of commit 77a10fa80a - Show all commits

View File

@ -9,13 +9,46 @@ class Intval {
this._declarePins()
}
_declarePins () {
this._pin.four = gpio.export(4, {
this._pin.fwd = gpio.export(4, {
direction: 'out',
interval: 100,
ready : () => {
console.info(`Set pin 4 to OUTPUT`)
}
})
this._pin.bwd = gpio.export(5, {
direction: 'out',
interval: 100,
ready : () => {
console.info(`Set pin 5 to OUTPUT`)
}
})
}
_startFwd () {
this._pin.fwd.set(1)
this._pin.bwd.set(0)
}
_startBwd () {
this._pin.fwd.set(0)
this._pin.bwd.set(1)
}
frame (dir = true, time = 0, delay = 0) {
if (delay !== 0) {
setTimeout(function () {
if (dir) {
this._startFwd()
} else {
this._startBwd()
}
}, delay)
} else {
if (dir) {
this._startFwd()
} else {
this._startBwd()
}
}
}
status () {
return {}