# File lib/commands/motor.rb, line 119
  def stop
    if @next_action == :brake
      @nxt.set_output_state(
        NXTComm.const_get("MOTOR_#{@port.to_s.upcase}"),
        0,
        NXTComm::MOTORON | NXTComm::BRAKE | NXTComm::REGULATED,
        NXTComm::REGULATION_MODE_MOTOR_SPEED,
        0,
        NXTComm::MOTOR_RUN_STATE_RUNNING,
        0
      )
    else
      @nxt.set_output_state(
        NXTComm.const_get("MOTOR_#{@port.to_s.upcase}"),
        0,
        NXTComm::COAST,
        NXTComm::REGULATION_MODE_IDLE,
        0,
        NXTComm::MOTOR_RUN_STATE_IDLE,
        0
      )
    end
  end