Push dev work to master #2
|
@ -140,7 +140,7 @@ intval._stop = function () {
|
||||||
const now = +new Date()
|
const now = +new Date()
|
||||||
const len = now - intval._state.frame.start
|
const len = now - intval._state.frame.start
|
||||||
|
|
||||||
log.info(`Frame stopped ${len}ms`)
|
log.info(`_stop`, { frame : len })
|
||||||
|
|
||||||
intval._pin.micro.unwatch()
|
intval._pin.micro.unwatch()
|
||||||
intval._state.frame.active = false
|
intval._state.frame.active = false
|
||||||
|
@ -166,13 +166,13 @@ intval._watchMicro = function (err, val) {
|
||||||
if (err) {
|
if (err) {
|
||||||
log.error('_watchMicro', err)
|
log.error('_watchMicro', err)
|
||||||
}
|
}
|
||||||
log.info(`Microswitch val: ${val}`)
|
//log.info(`Microswitch val: ${val}`)
|
||||||
//determine when to stop
|
//determine when to stop
|
||||||
if (val === 0 && intval._state.frame.active) {
|
if (val === 0 && intval._state.frame.active) {
|
||||||
if (!intval._state.micro.primed) {
|
if (!intval._state.micro.primed) {
|
||||||
intval._state.micro.primed = true
|
intval._state.micro.primed = true
|
||||||
intval._state.micro.time = NOW
|
intval._state.micro.time = NOW
|
||||||
log.info('Microswitch primed to stop motor')
|
//log.info('Microswitch primed to stop motor')
|
||||||
}
|
}
|
||||||
} else if (val === 1 && intval._state.frame.active) {
|
} else if (val === 1 && intval._state.frame.active) {
|
||||||
if (intval._state.micro.primed && !intval._state.micro.paused) {
|
if (intval._state.micro.primed && !intval._state.micro.paused) {
|
||||||
|
|
Loading…
Reference in New Issue