Let us go back to the class LightSwitch, that is initially switched off and switched on at time 5. Change this class to contain a when-statement instead of a when-equation.

Now change the LightSwitch class so that it in the time interval 5-20 turns the light on every fifth second for one second and then it it switched off again.

1.1
Tip

sample(start, interval) returns true and triggers time events at time instants and rem(x, y) returns the integer remainder of x/y, such that div(x,y) * y + rem(x, y) = x.