Guide

Pressure Sensor Solution

Fix the pressure sensor by checking whether the current reading is odd or even, then stabilize it.

Video-verified repair pattern · checked 2026-09-08

Guide artwork focused on a pressure gauge and diagnostics console at a frozen base
Guide artwork — not an in-game screenshot.

Quick answer

To repair the pressure sensor, read its live value and test whether it is even. If the reading is already even, keep it. If it is odd, add one. After that, call stabilize() with the corrected number. The cleanest starter check uses modulo 2 in an if/else block.

Working script

p_sensor = get_component("pressure sensor")
p = p_sensor.get_value()

if p % 2 == 0:
    fixed = p
else:
    fixed = p + 1

p_sensor.stabilize(fixed)

How the odd/even check works

p % 2 gives the remainder after dividing by two. An even number leaves remainder 0; an odd number leaves remainder 1. The starter objective says even readings are valid, while odd readings need to be bumped up by one.

Debug it before you stabilize

If you are still learning conditions, temporarily print the current reading and your branch result. That lets you prove the if/else logic before the objective clears and moves on.

Most common mistakes

  • Using = where the condition needs ==.
  • Forgetting indentation under if or else.
  • Using normal division instead of modulo to test odd/even state.
  • Calling the wrong final method. The pressure repair uses stabilize().