<commit_before>const int outPinLed = 2;
const int inPinTrigger = 7;
const int inPinDetector = 4;

int triggerPressed = 0;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  
  pinMode(outPinLed, OUTPUT);
  digitalWrite(outPinLed, LOW);

  pinMode(inPinTrigger, INPUT);
  pinMode(inPinDetector, INPUT);

}

void loop() {
  int triggerPrev = triggerPressed;
  triggerPressed = digitalRead(inPinTrigger);
  if (triggerPressed != triggerPrev) {
    Serial.print("Trigger state changed: ");
    Serial.println(triggerPressed);
    if (triggerPressed) {
      int detectorValue = digitalRead(inPinDetector);
      
      Serial.print("Detector: ");
      Serial.println(detectorValue);
    }
  }
    
  int ledState = triggerPressed ? HIGH : LOW;
  digitalWrite(outPinLed, ledState);

}<commit_msg>Read detector value to A0<commit_after>const int outPinLed = 2;
const int inPinTrigger = 7;
const int inPinDetector = A0;

int triggerPressed = 0;
int detectorValue = 1023;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  
  pinMode(outPinLed, OUTPUT);
  digitalWrite(outPinLed, LOW);

  pinMode(inPinTrigger, INPUT_PULLUP);
}

void loop() {
  int triggerPrev = triggerPressed;
  triggerPressed = digitalRead(inPinTrigger);
  if (triggerPressed != triggerPrev) {
    Serial.print("Trigger state changed: ");
    Serial.println(triggerPressed);
    /*if (triggerPressed) {
      int detectorValue = analogRead(inPinDetector);
      
      Serial.print("Detector: ");
      Serial.println(detectorValue);
    }*/
  }
  if (triggerPressed) {
    int detectorPrev = detectorValue;
    detectorValue = analogRead(inPinDetector);    
    Serial.print("     Detector: ");
    Serial.print(detectorValue);
    Serial.print("   diff=");
    Serial.println(detectorValue - detectorPrev);
  }
  
  int ledState = triggerPressed ? HIGH : LOW;
  digitalWrite(outPinLed, ledState);

}
{'fraction_non_alphanumeric': 0.11450777202072539, 'fraction_numerical': 0.010880829015544042, 'mean_word_length': 3.7679012345679013, 'pattern_counts': {'":': 0, '<': 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': '474709', 'n_tokens_mistral': 654, 'n_tokens_neox': 637, 'n_words': 143}