adafruit_us100

CircuitPython library for reading distance and temperature via US-100 ultra-sonic sensor

  • Author(s): ladyada

Implementation Notes

Software and Dependencies:

class adafruit_us100.US100(uart)

Control a US-100 ultrasonic range sensor.

distance

Return the distance measured by the sensor in cm. This is the function that will be called most often in user code. If no signal is received, return None. This can happen when the object in front of the sensor is too close, the wiring is incorrect or the sensor is not found. If the signal received is not 2 bytes, return None. This means either the sensor was moving too fast to be pointing in the right direction to pick up the ultrasonic signal when it bounced back (less likely), or the object off of which the signal bounced is too far away for the sensor to handle. In my experience, the sensor can not detect objects over 460 cm away. :return: Distance in centimeters. :rtype: float

temperature

Return the on-chip temperature, in Celsius