task_ultrasonic module¶
task_ultrasonic.py
Cooperative scheduler task that wraps the UltrasonicSensor driver. On startup a 3-sample moving-average filter is enabled. Each scheduler tick calls sensor.loop() to advance the non-blocking measurement state machine, then publishes the latest distance (or 0 if no reading is available) to a shared variable.