Example Solutions

Below are a number of example solutions to the handwashing problem. As you can see there are many ways to tackle this challenge.

What do you notice with all the solutions?

Is there something in common with all of them?

Which do you think is the best one? Why?

Take a look at the three possible solutions and then either improve or make your own design.

Requirements:

Handsfree Device - we do not want to touch anything

Accurate timing - we need to wash for 20seconds

Start and Stop markers - we need to tell the user when the time starts and finishes

1️⃣  The Pausing method 

This first example uses the Pause command and the display screen to show a different icon every 5 seconds. 

The program starts when light levels drop below 20.

As 4 x 5 = 20, the user is notified after 20 seconds that the time has elapsed with a final display.

Example using the Pause command

2️⃣  The For While loop timer

This second example uses a For While loop, to count down from 20 to 0.  

The program starts when light levels drop below 20.

While Time elapsed is greater than 0, the loop will repeat showing the numbers counting down.   

Once Time elapsed = 0 we are notified with a visual and audio notification.

Example - Using a count down display

3️⃣  Using a Time variable and Running Time 

This final example counts up using variables and simple maths to work out the time remaining. Once the timer has reached the target time (20secs) then we are notified with visual and audio notifications.


Example of a counting up program

Take a look at the possible solutions and then either improve or make your own design.

Once you have done this you can share or respond again in Seesaw.

Learning Intention

Can I code a simple computer?

SuccessCriteria

I can read simple programs

I can compare scripts

I can iterate my own design