You simply read the Arduino pin to which the sensor is connected in the main loop().
You have to record the time in millis() when the last movement was detected to be able to turn the light off after a certain period.
You simply read the Arduino pin to which the sensor is connected in the main loop().
You have to record the time in millis() when the last movement was detected to be able to turn the light off after a certain period.