State Machine: Trick or Treat

This Halloween themed state machine has two of the more obvious states (trick vs. treat) and a third, more passive state (no one is at the door).

The planned sensors and actuators are shown in this Paint diagram:
Oreo Trick or Treat

When someone arrives at the door, the program leaves the passive “no one at door” state. The visitor makes their intentions clear with a switch (trick vs. treat) which is displayed on a lit sign. In the “treat” state, the dispenser rolls out a tray of Oreo cookies. When the visitor leaves, the passive state resumes and the tray retracts. The “trick” state isn’t particularly useful with the current actuators; mostly it waits for the trickster to leave or request a treat.

I built all of the parts and programmed them, but the Oreo-dispenser doesn’t work on its own.

The Oreo Dispenser
Oreo-Serving Servo

The Door
Picture 24

The Circuit Board
Picture 25

Download Code


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: