   pinMode(outPinLed, OUTPUT);
   digitalWrite(outPinLed, LOW);
 
-  pinMode(inPinTrigger, INPUT);
-  pinMode(inPinDetector, INPUT);
-
+  pinMode(inPinTrigger, INPUT_PULLUP);
 }
 
 void loop() {

  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);


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:
