Hi I’m just getting start with lighting. I want to make lighting circuit using motion sensor to turn on an LED but the hardest part that I cannot solve is that I want my LED changes the color every time motion sensor work. Like 1st time blue turn on and for 2nd time red turn on and repeat in a set. Is it possible to do something like this?
I'd advise learning about state machines - then you just have to draw out the
state-transition diagram for your LED logic and map this directly to code. The
state here presumably represents the last LED colour.