step.wait_for_digital ===================== .. py:module:: step.wait_for_digital Classes ------- .. autoapisummary:: step.wait_for_digital.WaitForDigital Module Contents --------------- .. py:class:: WaitForDigital(sensor: raccoon.hal.DigitalSensor, pressed: bool = True) Bases: :py:obj:`step.base.Step` Block until a digital sensor reads the desired state. Polls the sensor at 50 Hz and resumes execution once the reading matches the expected value. Useful for waiting until a bumper is pressed, a limit switch is triggered, or an external signal arrives. :param sensor: The DigitalSensor instance to poll. :param pressed: The target state to wait for. ``True`` (default) waits until the sensor reads high; ``False`` waits until it reads low. Example:: from raccoon.step import wait_for_digital from raccoon.hal import DigitalSensor bumper = DigitalSensor(0) # Wait until bumper is pressed wait_for_digital(bumper) # Wait until bumper is released wait_for_digital(bumper, pressed=False)