Set pause flag before frame is actually paused. To prevent stop events when motor slows.
This commit is contained in:
parent
ca8f6b2be9
commit
58267bf71c
|
@ -122,7 +122,6 @@ intval._startBwd = function () {
|
|||
intval._pause = function () {
|
||||
intval._pin.fwd.writeSync(0)
|
||||
intval._pin.fwd.writeSync(0)
|
||||
intval._state.micro.paused = true
|
||||
}
|
||||
/**
|
||||
* Stop motor by setting both motor pins to 0 (LOW)
|
||||
|
@ -288,6 +287,7 @@ intval.frame = function (dir = null, time = null) {
|
|||
intval._startBwd()
|
||||
}
|
||||
if (time !== 0) {
|
||||
intval._state.micro.paused = true
|
||||
setTimeout(intval._pause, intval._state.frame.open)
|
||||
if (dir) {
|
||||
log.info('frame', { pausing : time - intval._state.frame.open })
|
||||
|
|
Loading…
Reference in New Issue