From c89add4de9ed40a0a41aff1932bf25573f2d8c5a Mon Sep 17 00:00:00 2001 From: Kevin Andersen Date: Mon, 15 Jul 2019 09:48:12 -0400 Subject: [PATCH] Added START_POWER enum to BoostOutputSubCommand which allows the extension to use unregulated motor commands with the Move Hub. Changed BoostMotor.turnOff() to use unregulated motor commands since it seems like a more reliable way of turning the motor off --- src/extensions/scratch3_boost/index.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/extensions/scratch3_boost/index.js b/src/extensions/scratch3_boost/index.js index 8934d5a77..29a8640b2 100644 --- a/src/extensions/scratch3_boost/index.js +++ b/src/extensions/scratch3_boost/index.js @@ -160,6 +160,7 @@ const BoostMessage = { * @enum {number} */ const BoostOutputSubCommand = { + START_POWER: 0x01, START_POWER_PAIR: 0x02, SET_ACC_TIME: 0x05, SET_DEC_TIME: 0x06, @@ -541,12 +542,10 @@ class BoostMotor { turnOff (useLimiter = true) { const cmd = this._parent.generateOutputCommand( this._index, - BoostOutputExecution.EXECUTE_IMMEDIATELY ^ BoostOutputExecution.COMMAND_FEEDBACK, - BoostOutputSubCommand.START_SPEED, + BoostOutputExecution.EXECUTE_IMMEDIATELY, + BoostOutputSubCommand.START_POWER, [ - BoostMotorEndState.FLOAT, - BoostMotorEndState.FLOAT, - BoostMotorProfile.DO_NOT_USE + BoostMotorEndState.FLOAT ] );