Go to the documentation of this file.
38 #define SRF02_DEFAULT_ADDR (0xe0)
43 #define SRF02_RANGE_DELAY (70000U)
uint8_t addr
I2C bus address of the sensor.
int srf02_set_addr(srf02_t *dev, uint8_t new_addr)
Program the given device with a new bus address.
@ SRF02_MODE_FAKE_INCH
result in inches (no pulse send)
unsigned int i2c_t
Default i2c_t type definition.
@ SRF02_MODE_REAL_INCH
result in inches
uint16_t srf02_read(const srf02_t *dev)
Read the results of the last ranging operation.
srf02_mode_t
Possible measurement modes of the SRF02 sensor.
i2c_t i2c
I2C device the sensor is connected to.
int srf02_trigger(const srf02_t *dev, srf02_mode_t mode)
Trigger a new measurement.
int srf02_init(srf02_t *dev, i2c_t i2c, uint8_t addr)
Initialize the SRF02 ultrasonic sensor.
Device descriptor for SRF02 sensors.
@ SRF02_MODE_REAL_MS
result in microseconds
@ SRF02_MODE_REAL_CM
result in centimeters
uint16_t srf02_get_distance(const srf02_t *dev, srf02_mode_t mode)
Get the distance measured from the SRF02 ultrasonic sensor.
@ SRF02_MODE_FAKE_CM
result in cm (no pulse send)
Low-level I2C peripheral driver interface definition.
@ SRF02_MODE_FAKE_MS
result in ms (no pulse send)