Was not actually calling intval._stop(). How embarassing?

This commit is contained in:
mmcw-dev 2017-10-19 22:03:13 -04:00
parent 0b47713c58
commit b7dd9e4fa1
1 changed files with 4 additions and 4 deletions

View File

@ -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)
}
}