const int irSensorPin = 11; // IR sensor connected to digital pin 5
const int ledPin = 13; // LED connected to pin 13 (onboard LED)
void setup() {
pinMode(irSensorPin, INPUT); // Set IR sensor pin as input
pinMode(ledPin, OUTPUT); // Set LED pin as output
Serial.begin(9600); // Initialize Serial Monitor
}
void loop() {
int motionDetected = digitalRead(irSensorPin); // Read the IR sensor state
if (motionDetected == HIGH) { // Motion detected
Serial.println("IOT PROJECT GIRLS!"); // Print status
digitalWrite(ledPin, HIGH); // Turn on LED
} else {
Serial.println("IOT PROJECT GIRLS."); // Print status
digitalWrite(ledPin, LOW); // Turn off LED
}
delay(100); // Short delay for readability
}