[Lab] Arduino LED Strip, PIR, and Relay

Dave Hunt dave at huntgang.com
Fri Mar 2 14:28:19 EST 2018


I think you need some non-blocking code in there.  The use of delay sits
and waits and does not check the status of the motion detector while it is
waiting.  So any time it is triggered, it should turn on the light and then
"hang" before turning off the light and starting to check for motion again.

What I would do is use millis function.  Look at the blink without delay
(non blocking code) for an example.  then anytime I saw montion I would
change the counter to current millis + "on timer length"

Hope this helps.

On Fri, Mar 2, 2018 at 12:50 PM, Bruce Harding <bsharding at rogers.com> wrote:

> 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:
> https://gist.github.com/anonymous/8f0be0ffb6366ebe814c6d9b0ef7cd49
>
> pics of the project:
> https://photos.app.goo.gl/QrgMDG1KMnpNUjdy2
>
> I'm using the Grove Shield and Relay
> http://wiki.seeed.cc/Grove-Relay/
>
> PS. I've not coding experience
>
> ====
> bruce
> faintfuzzies.ca
>
> _______________________________________________
> Lab mailing list
> 1. subscribe https://artengine.ca/mailman/listinfo/lab
> 2. then email Lab at artengine.ca to send your message to the list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://artengine.ca/pipermail/lab/attachments/20180302/d2584d7a/attachment.html>


More information about the Lab mailing list