// detecteur de presence infrarouge PIR HC-SR501

// carte Arduino nano

// definition des ports

const int pirPin = 2;
const int ledPin = 3;

void setup() {
  pinMode(pirPin, INPUT);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  int motion = digitalRead(pirPin); 
  if (motion == HIGH) {
    digitalWrite(ledPin, HIGH);
  } else {
    digitalWrite(ledPin, LOW);
  }
}