What you learn today
- Set breakpoints
- Watch registers
- Recreate scenarios
Some errors only show over time. The pantry cooler switches, just far too often – and in the game you only notice that after half an hour from the power use. In the IC10 coder's simulator you fast-forward that half hour in seconds.
Stopping where it gets interesting
- Breakpoint: click a line number. “Run” stops before that line.
- Step runs exactly one line, Tick a whole tick – up to the next
yield, asleepor the 128 instructions. - Stop on error halts on the line that raises a runtime error.
- Strict mode only allows LogicTypes that are entered on the device – just as real devices do not know every value.
Watching registers
The register table shows every value with its alias name. With the curve button you add a register to the history and see how it changes over many ticks. Under writes you find which line wrote which value into which device. If the chip writes something you do not expect, you find the line there.
Recreating scenarios
Devices in the simulator have no physics. You add it yourself:
| Tool | Effect | Example |
|---|---|---|
| Δ/tick | value changes every tick | pantry warms up: Temperature +0.5 |
| Coupling | target += factor × source, every tick | cooler cools: Temperature += −1.5 × cooler.On |
With both together the pantry swings like in the game: it gets warm, the cooler starts, it cools down. In the history of on you see straight away whether the hysteresis is right. Here it is the wrong way round:
sgt tmp temp AUS # bug: this should be EIN
or on on tmp
sge tmp temp EIN # bug: this should be AUS
and on on tmp
With swapped limits the cooler switches on at 6 °C and off again just below 6 °C. The history shows twitching instead of long cooling phases.
The simulator is not the game. It only knows the values and couplings you enter. A test in the simulator shows that your logic is right – whether the device reacts the same way in the game only the build shows.
Diagram
Exercise
Task
The pantry cooling twitches. Recreate the scenario in the simulator (sensor Temperature Δ/tick +0.5, coupling Temperature += −1.5 × cooler.On) and watch on in the history. Then fix the hysteresis: the cooler “Kammer” turns on above 6 °C and only turns off again below 3 °C. If the sensor is missing, it keeps cooling.
Hints
Hint 1
Switching on belongs to the upper limit EIN, switching off to the lower limit AUS.
Hint 2
Swap AUS and EIN in the two comparisons – nothing else.
Hint 3
Test with 5 °C after switching on: the cooler has to keep running.
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