What you learn today
- Limits and priorities
- Acknowledge
- Collective alarm
Three lights for three problems are clear. With ten problems a wall full of lights hangs in the greenhouse, and nobody looks any more. A good alarm system reports one thing loudly, shows the most important one and can be silenced without the problem being forgotten.
Three parts of an alarm system
| Part | Device | Job |
|---|---|---|
| Collective alarm | one light | something is wrong |
| Display | LED display | which alarm is most important |
| Klaxon | speaker | something new has happened |
Limits and priorities
Every condition gets a number. A small number means important:
| Code | Condition |
|---|---|
| 1 | sensor missing – the greenhouse is blind |
| 2 | temperature outside 15 to 35 °C |
| 3 | water tank below 10 % or its analyzer missing |
| 4 | CO₂ below 0.5 % |
As yesterday you check from least to most important and overwrite with select. The display gets the code, the collective light is on as soon as it is not 0.
Acknowledging
The klaxon should not blare until the problem is fixed. Whoever hears it presses the button “Quittieren” and takes care of it. For that the chip remembers the acknowledged code:
lbn tmp BUTTON HASH("Quittieren") Activate Average
sgtz tmp tmp
select ack tmp code ack # pressed: remember
select ack code ack 0 # no alarm: forget
sne tmp code ack # not acknowledged?
sbn KLAXON HASH("Hupe") On tmp
The three lines do the following:
- Button pressed →
acktakes over the current code. - No alarm any more (
code= 0) →ackgoes back to 0. - The klaxon runs as long as the current code is not acknowledged.
If a different alarm comes, its code is not acknowledged and the klaxon comes on again. The light, on the other hand, stays on until everything really is fine.
A button only returns Activate 1 while it is pressed. Without ack as memory the klaxon would start howling again right after you let go.
The display only shows the most important alarm. If a water shortage joins an acknowledged cold alarm, the display stays at 2 and the klaxon stays quiet. How to hold several alarms at once in one number is something you learn in the bit week of the expert level.
Exercise
Task
Build the alarm system following the table above:
- display “Alarm” shows the most important code (1 to 4), otherwise 0
- light “Sammel” on as long as an alarm is active
- klaxon “Hupe” on as long as the current code has not been confirmed with the button “Quittieren”
Sensor “Gewaechshaus”, tank “Wassertank”.
Hints
Hint 1
Set codes 4, 3, 2 with select, at the very end snan tmp temp for code 1.
Hint 2
Tank: fill level as for watering, NaN also counts as code 3.
Hint 3
Acknowledge in three lines: select ack tmp code ack, select ack code ack 0, sne tmp code ack.
Quiz
4 questions. You pass from 60 % – the server does the grading.
Complete the day
- Passed the simulator exercise
- Passed the quiz with at least 60 %
Without an account progress is saved in this browser only.
Report a mistake in this lesson
Please sign in to report. Sign in