Was not actually calling intval._stop(). How embarassing?
This commit is contained in:
parent
0b47713c58
commit
b7dd9e4fa1
|
@ -124,8 +124,8 @@ intval._startBwd = function () {
|
|||
intval._stop = function () {
|
||||
intval._pin.fwd.writeSync(0)
|
||||
intval._pin.bwd.writeSync(0)
|
||||
|
||||
let len = (+new Date()) - intval._state.frame.start
|
||||
const now = +new Date()
|
||||
const len = now - intval._state.frame.start
|
||||
|
||||
log.info(`Frame stopped ${len}ms`)
|
||||
|
||||
|
@ -158,14 +158,14 @@ intval._watchMicro = function (err, val) {
|
|||
if (!intval._state.micro.primed) {
|
||||
intval._state.micro.primed = true
|
||||
intval._state.micro.time = NOW
|
||||
log.info('Mircoswitch primed to stop motor')
|
||||
log.info('Microswitch primed to stop motor')
|
||||
}
|
||||
} else if (val === 1 && intval._state.frame.active) {
|
||||
if (intval._state.micro.primed) {
|
||||
intval._state.micro.primed = false
|
||||
intval._state.micro.time = 0
|
||||
setTimeout( () => {
|
||||
log.info(`Stopped frame after ${NOW - intval._state.micro.time}ms`)
|
||||
intval._stop()
|
||||
}, intval._microDelay)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue