// Define pin numbers for the components
int pir = 10; // Pin number connected to the PIR motion sensor
int led = 13; // Pin number connected to the LED
void setup() {
// Set up the digital pin modes
pinMode(pir, INPUT); // Set the PIR sensor pin as an input to read motion
pinMode(led, OUTPUT); // Set the LED pin as an output to light up the LED
}
void loop() {
// Read the digital input from the PIR motion sensor
int value = digitalRead(pir); // Read the state of the PIR sensor (HIGH or LOW)
// Write the same state to the LED
digitalWrite(led, value); // Set the LED HIGH when motion is detected and LOW otherwise
}