stationeers.de Mod workshop · Dominik1199
DE Sign in
  1. Home
  2. IC10 academy
  3. Day 76

Day 76 of 365 · Beginner · Month 3: First systems

Project: greenhouse lighting

One chip for the greenhouse: grow lights on a schedule, a harvest lamp with ripeness display and a lever for permanent light.

Project 30 min Week 11

What you learn today

  • Switch grow lights on a schedule
  • Show ripeness
  • Control lights together

The greenhouse gets its own control: grow lights on a schedule, a lamp for the harvest and a lever for permanent light while you work inside. Everything from this week in one chip.

The setup

DevicePrefabName
grow lightsStructureGrowLightPflanzenlicht
hydroponics devicesStructureHydroponicsTrayData–
wall lightStructureWallLightErnte
LED displayStructureConsoleLED5Reife
leverStructureLogicSwitchDauerlicht

All grow lights have the same name. A single sbn switches them together, whether there are two or twenty. The trays need no name, lbs reads them by their type.

Milestones

  1. Light on schedule: in every period of PERIOD ticks the grow lights are on for the first ON ticks, then off.
  2. Ripeness: the lamp “Ernte” lights up as soon as a plant is ripe. The display “Reife” shows the progress of the most advanced plant in percent.
  3. Permanent light: if the lever is on, the grow lights stay on. The schedule keeps running in the background.
  4. Failure: if the trays are missing, the display shows 0 and the lamp “Ernte” is off. If the lever is missing, the schedule applies.

Times for the test

In the test the times are short: PERIOD 30 and ON 20 ticks. In the game you enter your real plan, for example 7200 and 4800 for one hour with 40 minutes of light.

define PERIOD 30 # ticks per light period (in game e.g. 7200)
define ON 20 # light ticks per period (in game e.g. 4800)
move time 0

The move time 0 sits before the start label. That way the plan starts cleanly from the beginning after every upload.

Tip

The lever reports its position in Open. If it is missing, Average returns NaN. sgtz turns that into 0, and the schedule applies – without an extra check.

Warning

Do not build the schedule with sleep. During sleep the chip stands still. The harvest lamp and the lever would only react after it wakes up.

Diagram

A locker with numbered slots Locker (d0) Slot 0 Iron ore Occ 1 Qty 5 Slot 1 Copper ore Occ 1 Qty 12 Slot 2 empty Occ 0 Qty 0 Slot 3 empty Occ 0 Qty 0 ls r0 d0 0 Occupied r0 = 1 ls r1 d0 1 Quantity r1 = 12 Slots count from 0. Values in a slot are called LogicSlotTypes.
All grow lights carry the same name. One sbn switches them together, the trays report through lbs on slot 0.

Project task

Task

Build the greenhouse control as described above. Devices and names:

  • grow lights “Pflanzenlicht” (StructureGrowLight, two of them)
  • three hydroponics devices (no names)
  • wall light “Ernte”, LED display “Reife”
  • lever “Dauerlicht” (StructureLogicSwitch, value Open)

The milestones are listed above the editor.

Milestones

  1. Milestone 1: light on schedule
  2. Milestone 2: ripeness
  3. Milestone 3: permanent light
  4. Milestone 4: trays and lever fail

Hints

Hint 1

Schedule: add time time 1, mod time time PERIOD, slt light time ON.

Hint 2

Lever: lbn … Open Average, then sgtz and or light light always.

Hint 3

Harvest and ripeness as in lesson 74: lbs … Mature Maximum and lbs … MaturityRatio Maximum.

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

Esc
↑ ↓ selectEnter open/ opens search anywhere