LEDs blinking duration and without motion

HKJ-lygte:
The idea is to keep the timer at maximum time while the PIR is active. This is done by recording a time 0.3 second in the future.

As long as the timer has a value in the future the output is turned on, when the timer has not been reset for some some time (0.3second) the milles() will be larger than the timer and the output will turn off.
For the digitalWrite I used a boolean parameter instead of HIGH/LOW, this works just as well (TRUE=HIGH, FALSE=LOW).

Hi! I implemented your code however, it does not help. As increasing the 0.3 seconds just increased the the time the LED was on and when I decreased it the LED started blinking on its own. Yet I did notice(on my code) that sometimes there is a delay in turning the LED on. this means that after some initial motion which causes the LED to turn on, when it switches off and there is motion, it does not light up immediately, rather it takes 1-2 seconds which needs to be fixed but even using your code and changing the timer value the results were pretty much the same.