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.

A8_statemachine_states

States

Arduino Sketch: DenzilFerreira_A8_state_machine

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: