xxxxxxxxxx
// Check if the entered password matches the correct password
// Define pins for LEDs
const int greenLEDPin = 9;
const int redLEDPin = 10;
// Predefined correct password
String correctPassword = "1234";
void setup() {
// Initialize the LED pins as outputs
pinMode(greenLEDPin, OUTPUT);
pinMode(redLEDPin, OUTPUT);
// Initialize Serial communication at 9600 baud rate
Serial.begin(9600);
// Turn off both LEDs at start
digitalWrite(greenLEDPin, LOW);
digitalWrite(redLEDPin, LOW);
Serial.println("Enter password:");
}
void loop() {
// Check if data is available to read
if (Serial.available() > 0) {