const int buttonPin1 = 2; // Employee
const int buttonPin2 = 4; // Guard
const int ledPin = 5; // LED
bool isLEDOn = false;
void setup() {
pinMode(buttonPin1, INPUT_PULLUP);
pinMode(buttonPin2, INPUT_PULLUP);
pinMode(ledPin, OUTPUT);
}
void loop() {
if (digitalRead(buttonPin1) == LOW) {
// Button 1 pressed, turn on the LED
digitalWrite(ledPin, HIGH);
isLEDOn = true;
}
if (digitalRead(buttonPin2) == LOW) {
// Button 2 pressed, turn off the LED
digitalWrite(ledPin, LOW);
isLEDOn = false;
}
}