# File lib/commands/move.rb, line 140
  def stop
    if @next_action == :brake
      if @ports.include?(:a) and @ports.include?(:b) and @ports.include?(:c)
        @nxt.set_output_state(
          NXTComm::MOTOR_ALL,
          0,
          NXTComm::MOTORON | NXTComm::BRAKE | NXTComm::REGULATED,
          NXTComm::REGULATION_MODE_MOTOR_SPEED,
          0,
          NXTComm::MOTOR_RUN_STATE_RUNNING,
          0
        )
      else
        @ports.each do |p|
          @nxt.set_output_state(
            NXTComm.const_get("MOTOR_#{p.to_s.upcase}"),
            0,
            NXTComm::MOTORON | NXTComm::BRAKE | NXTComm::REGULATED,
            NXTComm::REGULATION_MODE_MOTOR_SPEED,
            0,
            NXTComm::MOTOR_RUN_STATE_RUNNING,
            0
          )
        end
      end
    else
      if @ports.include?(:a) and @ports.include?(:b) and @ports.include?(:c)
        @nxt.set_output_state(
          NXTComm::MOTOR_ALL,
          0,
          NXTComm::COAST,
          NXTComm::REGULATION_MODE_IDLE,
          0,
          NXTComm::MOTOR_RUN_STATE_IDLE,
          0
        )
      else
        @ports.each do |p|
          @nxt.set_output_state(
            NXTComm.const_get("MOTOR_#{p.to_s.upcase}"),
            0,
            NXTComm::COAST,
            NXTComm::REGULATION_MODE_IDLE,
            0,
            NXTComm::MOTOR_RUN_STATE_IDLE,
            0
          )
        end
      end
    end
  end