State Machines

Until now, you have learned about all the features that we need for state machines, but you have not yet created one on your own.

Revisit the preparation material on how to create state machines. Assign one in the group who guides a brief summary through the points, and discuss any things that you may need clarification for.

This is just to ensure that you remember the proceedings as you will need them today.

Errors in State Machines

Before we create our own state machines, let's criticize some others and find mistakes in them first.

For each of the state machines, formulate a short sentence (or two) that describe what's wrong with them. Collect these sentences in a text document while you work, then submit them as a form given below.

State Machine 1

 

State Machine 2

 

State Machine 3

 

State Machine 4

 

State Machine 5

 

State Machine 6

 

Delivery your diagnostics on the state machines in this form.

Getting Started: Bus Stop

You should build the state machine for a bus stop signal light. It is intended for bus stops where busses only halt when there are passengers, and which are located so that it is difficult for a bus driver to see passengers when they approach. It may also be that they need to get off a larger road, but can stay on that road if there are not passengers. The solution is a signal light that passengers can activate at the buss top and which is better visible for the approaching bus.

Sketch of the bus stop.  

Here are the detailed functional requirements:

Use the following elements:

You can ignore for now that the system may be switched off, so you need no final state.

Create a State Machine, Individually

Create a State Machine, Together

Solution

Store your document from above in the Teams folder for this unit. Use filname ttm4115-2020-bus-stop-team-XX.docx

Kitchen Timer

You should build the state machine for the following device:

It's a kitchen timer. It has 4 LEDs and a button. When the button is pressed, the first LED is switched on, and the plug provides electricity, for instance for a coffee machine. After 15 minutes, the LED is switched off and the plug is turned off. Whenever the button is pressed when an LED is already on, the next LED is switched on and time timer is set to 30, 45, or 60 minutes, respectively. If all LEDs are on, and the button is pressed, all LEDs and the plug are switched off.

You can ignore that the LED of the segment that is currently active is blinking, just assume it lights all the time.

Use the following actions:

You can assume that whenever the button is pressed, the state machine will receive a signal with the name switch.

Create a State Machine, Individually

Create a State Machine, Together

Solution

Store your document from above in the Teams folder for this unit. Use filename ttm4115-2020-kitchen-timer-team-XX.docx.

Team Reflection for This Unit

Individual Reflection