I am working with NeoPixel led strip and PIR sensor, I want to activate the led strip, when the PIR detects, but the problem I have is that while the PIR is detecting the led strip is always changing color for the reason that it is in random, is there any way to make that once the led strip is on, it does not change color while the PIR is activated?
Thank you!
Step back from coding.
Describe it pure functional.
There is a PIR-sensor.
Each time the PIR-sensor gets triggered
choose new colors and light up the neopixels with the chosen colors.
Keep the chosen colors. Do not RE-choose the colors all the time.
This means the starting-condition is the change from PIR-sensor LOW to PIR-Sensor HIGH
This is called state-change-detection.
Search the forum or with google for the term state-change-detection