<commit_before>#define DEBOUNCE 10  // button debouncer, how many ms to debounce, 5+ ms is usually plenty

// here is where we define the buttons that we'll use. button "1" is the first, button "6" is the 6th, etc
byte buttons[] = {3, 5}; // 12
String buttonNames[] = {"pb1", "pb2"};

// This handy macro lets us determine how big the array up above is, by checking the size
#define NUMBUTTONS sizeof(buttons)

byte potmeters[] = {14}; // A0-14, A5-19 6

String potmeterNames[] = {"pot1"};
// This handy macro lets us determine how big the array up above is, by checking the size
#define NUMPOTMETERS sizeof(potmeters)



// we will track if a button is just pressed, just released, or 'currently pressed'
byte pressed[NUMBUTTONS];

void setup() {
  byte i;

  // set up serial port
  Serial.begin(9600);
  Serial.print("Button checker with ");
  Serial.print(NUMBUTTONS, DEC);
  Serial.println(" buttons");
  // pin13 LED
  pinMode(13, OUTPUT);

  // Make input & enable pull-up resistors on switch pins
  for (i=0; i< NUMBUTTONS; i++) {
    pinMode(buttons[i], INPUT);
    digitalWrite(buttons[i], HIGH);
  }
}

void check_switches()
{
  static byte previousstate[NUMBUTTONS];
  static byte currentstate[NUMBUTTONS];
  static long lasttime;
  byte index;
  if (millis() < lasttime) {
     lasttime = millis(); // we wrapped around, lets just try again
  }

  if ((lasttime + DEBOUNCE) > millis()) {
    return; // not enough time has passed to debounce
  }
  // ok we have waited DEBOUNCE milliseconds, lets reset the timer
  lasttime = millis();

  for (index = 0; index < NUMBUTTONS; index++) {
    /*justpressed[index] = 0;       // when we start, we clear out the "just" indicators
    justreleased[index] = 0;*/
<commit_msg>Removed debug message<commit_after>#define DEBOUNCE 10  // button debouncer, how many ms to debounce, 5+ ms is usually plenty

// here is where we define the buttons that we'll use. button "1" is the first, button "6" is the 6th, etc
byte buttons[] = {3, 5}; // 12
String buttonNames[] = {"pb1", "pb2"};

// This handy macro lets us determine how big the array up above is, by checking the size
#define NUMBUTTONS sizeof(buttons)

byte potmeters[] = {14}; // A0-14, A5-19 6

String potmeterNames[] = {"pot1"};
// This handy macro lets us determine how big the array up above is, by checking the size
#define NUMPOTMETERS sizeof(potmeters)



// we will track if a button is just pressed, just released, or 'currently pressed'
byte pressed[NUMBUTTONS];

void setup() {
  byte i;

  // set up serial port
  Serial.begin(9600);
  // pin13 LED
  pinMode(13, OUTPUT);

  // Make input & enable pull-up resistors on switch pins
  for (i=0; i< NUMBUTTONS; i++) {
    pinMode(buttons[i], INPUT);
    digitalWrite(buttons[i], HIGH);
  }
}

void check_switches()
{
  static byte previousstate[NUMBUTTONS];
  static byte currentstate[NUMBUTTONS];
  static long lasttime;
  byte index;
  if (millis() < lasttime) {
     lasttime = millis(); // we wrapped around, lets just try again
  }

  if ((lasttime + DEBOUNCE) > millis()) {
    return; // not enough time has passed to debounce
  }
  // ok we have waited DEBOUNCE milliseconds, lets reset the timer
  lasttime = millis();

  for (index = 0; index < NUMBUTTONS; index++) {
    /*justpressed[index] = 0;       // when we start, we clear out the "just" indicators
    justreleased[index] = 0;*/

{'fraction_non_alphanumeric': 0.11969111969111969, 'fraction_numerical': 0.020196020196020195, 'mean_word_length': 3.5026737967914436, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, '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': '2641326', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1075, 'n_words': 425}