[Lab] Arduino LED Strip, PIR, and Relay

Darcy Whyte darcy at inventorartist.com
Fri Mar 2 15:41:33 EST 2018


You'll want to write this as "non-blocking". That means don't use delay.

Set up a variable to store the "lastMotionDetected". In your loop, every
time you detect motion, read the millis() clock into that variable. Every
time you write to the variable turn the light on. Also, monitor this
variable to see if 10 minutes has lapsed. Once it has lapsed, turn the
light off.

That'd be a start, does that help?





--
Darcy Whyte

Art+ inventorArtist.com <http://inventorartist.com/> | Makerspace
hack613.com | Aviation rubber-power.com
Contact: *darcy at inventorArtist.com* <darcy at inventorArtist.com> |
613-563-3634 by appointment (no text)


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/d7a19e3e/attachment.html>


More information about the Lab mailing list