(port="AD1")
| 625 | ''' |
| 626 | distance_sensor_output_str = "Distance Sensor" |
| 627 | def read_ultrasonic(port="AD1"): |
| 628 | UltraSonicSensor = get_sensor_instance(port, easysensors.UltraSonicSensor) |
| 629 | print("reading from ultrasonic sensor on port {}".format(port)) |
| 630 | distance = UltraSonicSensor.read() |
| 631 | if distance == 0: |
| 632 | known_sensors[port] = None |
| 633 | sensors["{}: distance".format(port)] = distance |
| 634 | if regObj.group(SENSOR_DISTANCE_PORT2): |
| 635 | port = "AD2" |
| 636 | elif regObj.group(SENSOR_DISTANCE_PORT1): |
no test coverage detected