<commit_before>int upPin = 13;
int aBPin = 12;
int selectPin = 11;
int downPin = 10;
int leftPin = 9;
int rightPin = 8;
int startCPin = 7;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(upPin, INPUT);
  pinMode(aBPin, INPUT);
  pinMode(selectPin, OUTPUT);
  pinMode(downPin, INPUT);
  pinMode(leftPin, INPUT);
  pinMode(rightPin, INPUT);
  pinMode(startCPin, INPUT);
}

void loop() {
  // first poll the buttons with Select=GND
  digitalWrite(selectPin, LOW);
  if(digitalRead(upPin) == LOW)
  {
    Serial.write("UP pressed\n");
  }
  if(digitalRead(downPin) == LOW)
  {
    Serial.write("DOWN pressed\n");
  }
  if(digitalRead(aBPin) == LOW)
  {
    Serial.write("A pressed\n");
  }
  if(digitalRead(startCPin) == LOW)
  {
    Serial.write("START pressed\n");
  }
  
  // now poll the buttons with Select=+5V
  digitalWrite(selectPin, HIGH);
  if(digitalRead(leftPin) == LOW)
  {
    Serial.write("LEFT pressed\n");
  }
  if(digitalRead(rightPin) == LOW)
  {
    Serial.write("RIGHT pressed\n");
  }
  if(digitalRead(aBPin) == LOW)
  {
    Serial.write("B pressed\n");
  }
  if(digitalRead(startCPin) == LOW)
  {
    Serial.write("C pressed\n");
  }
}
<commit_msg>Modified sketch to use byte flags for each button<commit_after>int upPin = 13;
int aBPin = 12;
int selectPin = 11;
int downPin = 10;
int leftPin = 9;
int rightPin = 8;
int startCPin = 7;

byte upFlag = B00000001;
byte downFlag = B00000010;
byte leftFlag = B00000100;
byte rightFlag = B00001000;
byte aFlag = B00010000;
byte bFlag = B00100000;
byte cFlag = B01000000;
byte startFlag = B10000000;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(upPin, INPUT);
  pinMode(aBPin, INPUT);
  pinMode(selectPin, OUTPUT);
  pinMode(downPin, INPUT);
  pinMode(leftPin, INPUT);
  pinMode(rightPin, INPUT);
  pinMode(startCPin, INPUT);
}

void loop() {
  // first poll the buttons with Select=GND
  digitalWrite(selectPin, LOW);
  if(digitalRead(upPin) == LOW)
  {
    Serial.write(upFlag);
  }
  if(digitalRead(downPin) == LOW)
  {
    Serial.write(downFlag);
  }
  if(digitalRead(aBPin) == LOW)
  {
    Serial.write(aFlag);
  }
  if(digitalRead(startCPin) == LOW)
  {
    Serial.write(startFlag);
  }
  
  // now poll the buttons with Select=+5V
  digitalWrite(selectPin, HIGH);
  if(digitalRead(leftPin) == LOW)
  {
    Serial.write(leftFlag);
  }
  if(digitalRead(rightPin) == LOW)
  {
    Serial.write(rightFlag);
  }
  if(digitalRead(aBPin) == LOW)
  {
    Serial.write(bFlag);
  }
  if(digitalRead(startCPin) == LOW)
  {
    Serial.write(cFlag);
  }
}

{'fraction_non_alphanumeric': 0.14757878554957723, 'fraction_numerical': 0.03689469638739431, 'mean_word_length': 3.631672597864769, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '914952', 'n_tokens_mistral': 1110, 'n_tokens_neox': 1018, 'n_words': 216}