Set pause flag before frame is actually paused. To prevent stop events when motor slows.

This commit is contained in:
mmcw-dev 2017-10-20 20:27:43 -04:00
parent ca8f6b2be9
commit 58267bf71c
1 changed files with 1 additions and 1 deletions

View File

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