8 – Afraid of the dark
My LED is afraid of the dark. So he has 3 states:
– Relaxed, where he pulses in 2 seconds interval
– Scared, when it’s dark, blinking a bit faster 0.5 seconds
– Paranoid, when he detects movement
He goes back to relaxed state when the light goes back to normal or there is no moment.
Arduino Sketch: DenzilFerreira_A8_state_machine