<commit_before>const int dPins[]  = {
  8,  // tilt sensor 1A
  9  // tilt sensor 1B
};

const int bPins[] = {
  A0,  // thumb
  A1,  // index
  A2,  // middle
  A3,  // ring
  A4  // pinky
};

int dNoPins = sizeof(dPins)/sizeof(int);
int bNoPins = sizeof(bPins)/sizeof(int);
int SAMPLES_PER_SECOND = 20;

int buttonPin = 12;

void setup() {
  // initialize serial communications at 9600 bps:
  Serial.begin(9600); 
  // set pin modes for digital pins
  for(int i = 0; i < dNoPins; i++){
    pinMode(dPins[i], INPUT); 
  }
  for(int i = 0; i < bNoPins; i++){
    pinMode(bPins[i], INPUT); 
    digitalWrite(bPins[i], HIGH);
  }
}

void loop() {
  //  // read and send digital value
  //  for(int i = 0; i < dNoPins; i++){
  //    sendInt16AsBytes(digitalRead(dPins[i]));
  //    digitalWrite(dPins[i], LOW);
  //  }
  //
  //  digitalWrite(buttonPin, HIGH);
  //
  //  if(digitalRead(buttonPin)){
  //    // Combine the tilt sensor values to one int
  //    //int tiltValue = (int)(digitalRead(dPins[0]) << 1 | digitalRead(dPins[1]));
  //    //sendInt16AsBytes(tiltValue);
  //
  //    // End transmission with a linebreak (sortof)
  //    Serial.write(10);
  //  }

  for(int i = 0; i < bNoPins; i++){
    int value = analogRead(bPins[i]);
    //int value = map(analogRead(bPins[i]), 0, 1023, 0, 1000);
    //Serial.print(value);
    sendInt16AsBytes(value);
  //Serial.println(value);
  }
 // Serial.println();
  // End transmission with a linebreak (sortof)
  Serial.write(10);
  // wait 
  // for the analog-to-digital converter to settle
  // after the last reading:
  delay(1000/SAMPLES_PER_SECOND);                     
}

/**<commit_msg>Add beeper to arduino<commit_after>const int dPins[]  = {
  8,  // tilt sensor 1A
  9  // tilt sensor 1B
};

const int bPins[] = {
  A0,  // thumb
  A1,  // index
  A2,  // middle
  A3,  // ring
  A4  // pinky
};

int dNoPins = sizeof(dPins)/sizeof(int);
int bNoPins = sizeof(bPins)/sizeof(int);
int SAMPLES_PER_SECOND = 20;

int beepPin = 10;
int buttonPin = 12;
boolean beeping = 0;
int counter = 0;

void setup() {
  // initialize serial communications at 9600 bps:
  Serial.begin(9600); 
  pinMode(beepPin, OUTPUT);
  digitalWrite(beepPin, LOW);
  // set pin modes for digital pins
  for(int i = 0; i < dNoPins; i++){
    pinMode(dPins[i], INPUT); 
  }
  for(int i = 0; i < bNoPins; i++){
    pinMode(bPins[i], INPUT); 
    digitalWrite(bPins[i], HIGH);
  }
}

void loop() {
  //  // read and send digital value
  //  for(int i = 0; i < dNoPins; i++){
  //    sendInt16AsBytes(digitalRead(dPins[i]));
  //    digitalWrite(dPins[i], LOW);
  //  }
  //
  //  digitalWrite(buttonPin, HIGH);
  //
  //  if(digitalRead(buttonPin)){
  //    // Combine the tilt sensor values to one int
  //    //int tiltValue = (int)(digitalRead(dPins[0]) << 1 | digitalRead(dPins[1]));
  //    //sendInt16AsBytes(tiltValue);
  //
  //    // End transmission with a linebreak (sortof)
  //    Serial.write(10);
  //  }

  for(int i = 0; i < bNoPins; i++){
    int value = analogRead(bPins[i]);
    //int value = map(analogRead(bPins[i]), 0, 1023, 0, 1000);
    //Serial.print(value);
    sendInt16AsBytes(value);
  //Serial.println(value);
  }
 // Serial.println();
  // End transmission with a linebreak (sortof)
  Serial.write(10);
  // wait 
  // for the analog-to-digital converter to settle
  // after the last reading:
  if (beeping && counter > 10)
  {
  digitalWrite(beepPin, HIGH);
  beeping = 0;
  counter = 0;
}
  else if (counter > 10)
  {
  digitalWrite(beepPin, LOW);
  beeping = 1;
  counter = 0;
}
counter++;
  delay(1000/SAMPLES_PER_SECOND);                    
}

/**
{'fraction_non_alphanumeric': 0.16911154165513423, 'fraction_numerical': 0.032106282867423196, 'mean_word_length': 2.5258536585365854, 'pattern_counts': {'":': 0, '<': 15, '<?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': '4984585', 'n_tokens_mistral': 1501, 'n_tokens_neox': 1401, 'n_words': 333}