Arduino LED Strips PIR and Relay

I'm trying to get the code for this project to work. I want the LEDs to stay on
for 10 minute or continue on if more motion is detected. right now the LED strip
turns off 2 seconds after no motion.

the code:

pics of the project:

I'm using the Grove Shield and Relay

PS. I've not coding experience

Do not use delays.. You need to learn how to use millis() as timer, or you need to use something like the SimpleTimer library (see setTimeout).

Well I've looked at the millis thing and I think I'm in trouble cause I've no clue how to go from what I've downloaded to use millis or timer. I dont't have a programmer's brain.

Thanks for your reply.

=====
DWW

Whenever the sensor returns movement, you must set a value (lastMovement) to current millis() and turn on the LED strip. For each loop you will then check if the last movement detected was >= 10 minutes ago. If this is the case, you switch of the LED strip. Should be quite simple (pseudocode):

unsigned long lastMovement = 0, loopMillis;

loop {

  loopMillis = millis()

  if movement-detected {

    ledStripOn()
    lastMovement = loopMillis

  } else if loopMillis - lastMovement >= 10 minutes {

    ledStripOff()

  }
}

I think you underestimate how dense I am. My learn disabilities make even the simplest of tasks difficult.

It is always nice to see that there are ppl will to help.

====
DWW

Feeling completely stupid. I mean really really stupid. The reason the delay was not working in my original sketch was that the relay was plugged into D4 which equals pin 4. So both the relay and the PIR where plugged into pin 4. DOH! Moved the relay plug to D5/Pin 5 on the Grove shield and everything worked.

Having said that I still need to learn how to covert this sketch from using delay to millis. I know for most you who read this it would be a snap. For me not so much more like a mountain. Hopefully with some help I'll get it done.

Thanks to Danois90 for his/her help.

====
DWW