What you learn today
- Retract radiators before the storm
- Extend them again afterwards
- Message on the display
This week showed you wind, weather, transformers, cables and heat power. The project combines the part that counts in every storm: warning, protection and the return to normal operation.
The plant
| Device | Prefab | Name |
|---|---|---|
| weather station (outside) | StructureWeatherStation | “Wetter” |
| two extendable radiators | StructureLargeExtendableRadiator | “Kuehler” |
| solid fuel generator | StructureSolidFuelGenerator | “Notstrom” |
| LED display | StructureConsoleLED5 | “Sturm” |
Which panels get protected
The radiators are large fold-out panels, and only they can really be protected: retracted (Open 0) they take no storm damage. That does not hold for solar panels – according to the game code their damage does not depend on the angle. That is why this guard turns no solar panels but makes sure the power is still enough: the storm damage makes unprotected panels weaker minute by minute, on average by about 6 % per minute, until someone repairs them.
The rules
Mode | Radiators | Backup power | Display | Colour |
|---|---|---|---|---|
| 0 calm | extended | off | 0 | green |
| 1 announced | retracted | on | seconds until the storm | yellow |
| 2 storm | retracted | on | 0 | red |
| missing (NaN) | retracted | on | −1 | red |
After the storm the station reports 0 again – then everything returns to normal operation by itself. That is the advantage of a state over a sequence: the chip does not have to remember anything, it derives everything from Mode every tick.
Milestones
- Radiators extended only in calm weather
- Backup power runs while the radiators are retracted
- Remaining time in seconds while the storm is announced
- Traffic light colour on the display
- Everything back after the storm, everything safe when the station is missing
The generator hangs on the radiator state: seqz gen open. That way the two can never work against each other, and the failure case is taken care of automatically.
Project task
Task
Build the storm guard following the table. The defines and reading Mode are already there, the four sections are missing.
Milestones
- Milestone 1: radiators only in calm weather
- Milestone 2: backup power with retracted radiators
- Milestone 3: show the remaining time
- Milestone 4: traffic light colour
- Milestone 5: back again and safe on failure
Hints
Hint 1
Radiators: seq open mode CALM – NaN gives 0, i.e. retracted.
Hint 2
Backup power is the opposite of the radiators: seqz gen open.
Hint 3
Remaining time and colour: seq tmp mode COMING, then pick time and yellow with select, afterwards red for RAGING and for a missing ok.
Quiz
2 questions. You pass from 60 % – the server does the grading.
Complete the day
- Passed all milestones of the project
- 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