Hallo, i started a program for a solar powered lamp. The neopixels are running in the program rainbow all the time. At the same time i have three PIR sensors. They activate a more powerful led.
My problem is, that the rainbow sketch is taking too much time and so the PIR is not working. Can u help me?
My arduino is a Arduino Nano.
I triet the attached Interrupt on pin 2 and 3 and took all 3 outputs of the PIRs at both with riseing and falling, but that didn‘t work.
Welcome to the forum.
Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
You, like every other NeoPixel newbie, have discovered that the Adafruit examples are blocking code. They simply run the Led patterns from start to finish without regard for anything else that you'd like to do at the same time. Makes sense because their purpose is to demonstrate the capabilities of the Led strips and how to use the NeoPixel library. They're really not meant for integration into larger projects.
To do other things at the same time you'll need to "unwind" the loops and learn to do timing with the millis() function instead of delays. Adafruit has a tutorial showing one (but not the only) way of doing this: