Architecturing a doorway LED project

For architecture, look to:

It like doesn't need to transition instantly. If you must use an interrupt, only use it to set a flag that a transition is needed, and then adjust your longer animations with the many hard-coded delays to check the flag and abort with 'break;'. Inserting a check such as this won't slow your delays much and could improve responsiveness.

for(int ii = 0; ii< NUMLEDS;++ii){ 
  ...
  if(activity || checkSensors()){break;)
  delay(500);
  ...
}
1 Like