step.wait_for_digital_dsl¶
Auto-generated step builders and DSL functions — DO NOT EDIT.
Source: wait_for_digital.py
Classes¶
Builder for WaitForDigital. Auto-generated — do not edit. |
Functions¶
|
Block until a digital sensor reads the desired state. |
Module Contents¶
- class step.wait_for_digital_dsl.WaitForDigitalBuilder¶
Bases:
raccoon.step.step_builder.StepBuilderBuilder for WaitForDigital. Auto-generated — do not edit.
- sensor(value: DigitalSensor)¶
- step.wait_for_digital_dsl.wait_for_digital(sensor: DigitalSensor = _UNSET, pressed: bool = True)¶
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.
- Parameters:
sensor – The DigitalSensor instance to poll.
pressed – The target state to wait for.
True(default) waits until the sensor reads high;Falsewaits until it reads low.
- Returns:
A WaitForDigitalBuilder (chainable via
.sensor(),.pressed(),.on_anomaly(),.skip_timing()).
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)