Assignment
Lathiya Nemish Embeeded System 20SE02CE032 SEIT3022 Practical 14 Create a Circuit to implement PIR motion Sensor. Code:- int sensorState = 0; void setup(){ pinMode(2, INPUT); pinMode(LED_BUILTIN, OUTPUT); Serial.begin(9600);} void loop(){ // read the state of the sensor/digital input sensorState = digitalRead(2); // check if sensor pin is HIGH. if it is, set the // LED on. if (sensorState == HIGH) { 1
Lathiya Nemish Embeeded System 20SE02CE032 SEIT3022 digitalWrite(LED_BUILTIN, HIGH); Serial.println("Sensor activated!"); } else { digitalWrite(LED_BUILTIN, LOW); } delay(10); // Delay a little bit to improve simulation performance} 2
PIR Motion Sensor Circuit - Embedded Systems
Please or to post comments