<commit_before>#include <Robot.h>

Robot::Robot() : led(13), button(A0, PULLUP), _running(false), _speed(1), _state(OFF) {
}

void Robot::init() {
    _left_motor.attach(9, 8, 7);
    _right_motor.attach(6, 5, 4);
    loadSettings();
}

void Robot::loadSettings() {
    byte left_min = EEPROM.read(LEFT_MIN_POWER_ADDRESS);
    byte right_min = EEPROM.read(RIGHT_MIN_POWER_ADDRESS);

    if (right_min > 100 || left_min > 100) {
        left_min = 50;
        right_min = 50;
    } else {
        _left_motor.setMinPower(left_min);
        _right_motor.setMinPower(right_min);
    }
}

void Robot::saveSettings() {
}

void Robot::forward(int speed) {
    _speed = speed;
    _state = FORWARD;
    _left_motor.forward(speed);
    _right_motor.forward(speed);
}

void Robot::reverse(int speed) {
    _speed = speed;
    _state = REVERSE;
    _left_motor.reverse(speed);
    _right_motor.reverse(speed);
}

void Robot::stop() {
    _left_motor.stop();
    _right_motor.stop();
    _state = STOPPED;
}

void Robot::off() {
    _left_motor.off();
    _right_motor.off();
    _state = OFF;
}

bool Robot::isRunning() {
    return _state != STOPPED && _state != OFF;
}
<commit_msg>Moves the init body to the class iniliser<commit_after>#include <Robot.h>

Robot::Robot() : 
        led(13), 
        button(A0, PULLUP),
        _left_motor(5, 8, 7),
        _right_motor(6, 9, 4),
        _running(false),
        _speed(1),
        _state(OFF) {
    loadSettings();
}

void Robot::init() {
}

void Robot::loadSettings() {
    byte left_min = EEPROM.read(LEFT_MIN_POWER_ADDRESS);
    byte right_min = EEPROM.read(RIGHT_MIN_POWER_ADDRESS);

    if (right_min > 100 || left_min > 100) {
        left_min = 50;
        right_min = 50;
    } else {
        _left_motor.setMinPower(left_min);
        _right_motor.setMinPower(right_min);
    }
}

void Robot::saveSettings() {
}

void Robot::forward(int speed) {
    _speed = speed;
    _state = FORWARD;
    _left_motor.forward(speed);
    _right_motor.forward(speed);
}

void Robot::reverse(int speed) {
    _speed = speed;
    _state = REVERSE;
    _left_motor.reverse(speed);
    _right_motor.reverse(speed);
}

void Robot::stop() {
    _left_motor.stop();
    _right_motor.stop();
    _state = STOPPED;
}

void Robot::off() {
    _left_motor.off();
    _right_motor.off();
    _state = OFF;
}

bool Robot::isRunning() {
    return _state != STOPPED && _state != OFF;
}

{'fraction_non_alphanumeric': 0.14439834024896264, 'fraction_numerical': 0.016597510373443983, 'mean_word_length': 3.114334470989761, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, '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': '4290417', 'n_tokens_mistral': 973, 'n_tokens_neox': 904, 'n_words': 161}