<commit_before>
#define THE_END -1

/**
 * Digital pins to use as inputs
 */
int dPinsIn[] = {
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13,
        THE_END
};

/**
 * Analog pins to report
 * @type {Number}
 */
int aPins[] = {
        0,
        1,
        2,
        4,
        3,
        5,
        6,
        7,
        THE_END
};

void setup() {
        for(int i = 0; dPinsIn[i] != THE_END; i++) {
                pinMode(dPinsIn[i], INPUT);
        }
        Serial.begin(115200);
}

void loop() {
        String dataString = String("{ ");
        for(int i = 0; dPinsIn[i] != THE_END; i++) {
                int pin = dPinsIn[i];
                dataString = dataString
                             + "\"" + "D" + pin + "\": "
                             + digitalRead(pin) + ", ";
        }
        for(int i = 0; aPins[i] != THE_END; i++) {
                int pin = aPins[i];
                dataString = dataString
                             + "\"" + "A" + pin + "\": "
                             + String(analogRead(pin) / 1023.0) + ", ";
        }

        Serial.write(
                (dataString.substring(0, dataString.length() - 2)
                 + " }\n"
                )
                .c_str()
                );
        delay(100);
}<commit_msg>arduino: sort pin numbers<commit_after>
#define THE_END -1

/**
 * Digital pins to use as inputs
 */
int dPinsIn[] = {
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13,
        THE_END
};

/**
 * Analog pins to report
 * @type {Number}
 */
int aPins[] = {
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        THE_END
};

void setup() {
        for(int i = 0; dPinsIn[i] != THE_END; i++) {
                pinMode(dPinsIn[i], INPUT);
        }
        Serial.begin(115200);
}

void loop() {
        String dataString = String("{ ");
        for(int i = 0; dPinsIn[i] != THE_END; i++) {
                int pin = dPinsIn[i];
                dataString = dataString
                             + "\"" + "D" + pin + "\": "
                             + digitalRead(pin) + ", ";
        }
        for(int i = 0; aPins[i] != THE_END; i++) {
                int pin = aPins[i];
                dataString = dataString
                             + "\"" + "A" + pin + "\": "
                             + String(analogRead(pin) / 1023.0) + ", ";
        }

        Serial.write(
                (dataString.substring(0, dataString.length() - 2)
                 + " }\n"
                )
                .c_str()
                );
        delay(10);
}
{'fraction_non_alphanumeric': 0.14754098360655737, 'fraction_numerical': 0.03169398907103825, 'mean_word_length': 0.9095966620305981, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, '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': '2837861', 'n_tokens_mistral': 946, 'n_tokens_neox': 885, 'n_words': 191}