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.
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.
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):
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.