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

  digitalWrite(outPinLed, LOW);

  pinMode(inPinTrigger, INPUT);

}


const int outPinLed = 2;
const int inPinTrigger = 7;
const int inPinDetector = 4;

int triggerPressed = 0;

