Merge pull request #2133 from evhan55/bugfix/2125

Prevent Boost turnOnForDegrees jittering on power set
This commit is contained in:
Evelyn Eastmond 2019-04-29 14:17:34 -04:00 committed by GitHub
commit e029b9e0e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1787,11 +1787,6 @@ class Scratch3BoostBlocks {
case BoostMotorState.ON_FOR_TIME: case BoostMotorState.ON_FOR_TIME:
motor.turnOnFor(motor.pendingTimeoutStartTime + motor.pendingTimeoutDelay - Date.now()); motor.turnOnFor(motor.pendingTimeoutStartTime + motor.pendingTimeoutDelay - Date.now());
break; break;
case BoostMotorState.ON_FOR_ROTATION: {
const p = Math.abs(motor.pendingPositionDestination - motor.position);
motor.turnOnForDegrees(p, Math.sign(p));
break;
}
} }
} }
}); });
@ -1838,11 +1833,6 @@ class Scratch3BoostBlocks {
case BoostMotorState.ON_FOR_TIME: case BoostMotorState.ON_FOR_TIME:
motor.turnOnFor(motor.pendingTimeoutStartTime + motor.pendingTimeoutDelay - Date.now()); motor.turnOnFor(motor.pendingTimeoutStartTime + motor.pendingTimeoutDelay - Date.now());
break; break;
case BoostMotorState.ON_FOR_ROTATION: {
const p = Math.abs(motor.pendingPositionDestination - motor.position);
motor.turnOnForDegrees(p, Math.sign(p));
break;
}
} }
} }
} }