ernjaeg5416

okay so im trying to write an if statement to turn on an led light to turn on when something passes in front of the sensor and stay on until (or turn off)when something passes through the sensor again.

Ex i walk into the room Led turns on and stays on until i exit the room.

new to arduino all together would appreciate any input here is the code i have with no needed libraries .