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

This commit is contained in:
Kevin Andersen 2019-07-15 09:48:12 -04:00
parent cc04fb0994
commit c89add4de9

View file

@ -160,6 +160,7 @@ const BoostMessage = {
* @enum {number} * @enum {number}
*/ */
const BoostOutputSubCommand = { const BoostOutputSubCommand = {
START_POWER: 0x01,
START_POWER_PAIR: 0x02, START_POWER_PAIR: 0x02,
SET_ACC_TIME: 0x05, SET_ACC_TIME: 0x05,
SET_DEC_TIME: 0x06, SET_DEC_TIME: 0x06,
@ -541,12 +542,10 @@ class BoostMotor {
turnOff (useLimiter = true) { turnOff (useLimiter = true) {
const cmd = this._parent.generateOutputCommand( const cmd = this._parent.generateOutputCommand(
this._index, this._index,
BoostOutputExecution.EXECUTE_IMMEDIATELY ^ BoostOutputExecution.COMMAND_FEEDBACK, BoostOutputExecution.EXECUTE_IMMEDIATELY,
BoostOutputSubCommand.START_SPEED, BoostOutputSubCommand.START_POWER,
[ [
BoostMotorEndState.FLOAT, BoostMotorEndState.FLOAT
BoostMotorEndState.FLOAT,
BoostMotorProfile.DO_NOT_USE
] ]
); );