<commit_before># see:
#   https://github.com/mindboards/ev3sources/blob/master/lms2012/c_output/source/c_output.c
module EV3
  module Commands
    class Output < Base
      MOTORS = {"A" => "\x01", "B" => "\x02", "C" => "\x04", "D" => "\x08"}
      ONE_MOTOR = {"A" => "\x00", "B" => "\x01", "C" => "\x02", "D" => "\x03"}
      BRAKE = "\x01"
      NO_BRAKE = "\x00"

      def ready(*motors)
        all_motors = union_motors(*motors)
        @message += ByteCodes::OUTPUT_READY.bytes +
        Layers::LAYER_0.bytes +
        [all_motors]
        return self
      end

      def start(*motors)
        all_motors = union_motors(*motors)
        @message += ByteCodes::OUTPUT_START.bytes +
        Layers::LAYER_0.bytes +
        [all_motors]
        return self
      end

      def speed(velocity, *motors)
        all_motors = union_motors(*motors)
        @message += ByteCodes::OUTPUT_SPEED.bytes +
        Layers::LAYER_0.bytes +
        [all_motors] +
        [velocity]
        return self
      end

      def reverse_polarity(direction, *motors)<commit_msg>bugfix motor speed<commit_after># see:
#   https://github.com/mindboards/ev3sources/blob/master/lms2012/c_output/source/c_output.c
module EV3
  module Commands
    class Output < Base
      MOTORS = {"A" => "\x01", "B" => "\x02", "C" => "\x04", "D" => "\x08"}
      ONE_MOTOR = {"A" => "\x00", "B" => "\x01", "C" => "\x02", "D" => "\x03"}
      BRAKE = "\x01"
      NO_BRAKE = "\x00"

      def ready(*motors)
        all_motors = union_motors(*motors)
        @message += ByteCodes::OUTPUT_READY.bytes +
        Layers::LAYER_0.bytes +
        [all_motors]
        return self
      end

      def start(*motors)
        all_motors = union_motors(*motors)
        @message += ByteCodes::OUTPUT_START.bytes +
        Layers::LAYER_0.bytes +
        [all_motors]
        return self
      end

      def speed(velocity, *motors)
        all_motors = union_motors(*motors)
        @message += ByteCodes::OUTPUT_SPEED.bytes +
        Layers::LAYER_0.bytes +
        [all_motors] +
        ArgumentSize::BYTE.bytes +
        [velocity]
        return self
      end

      def reverse_polarity(direction, *motors)
{'fraction_non_alphanumeric': 0.15243342516069788, 'fraction_numerical': 0.02662993572084481, 'mean_word_length': 2.2329376854599405, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5418494', 'n_tokens_mistral': 807, 'n_tokens_neox': 773, 'n_words': 142}