mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 05:12:57 +01:00
SRF08 driver, updated rangig function getting the number of echos
This commit is contained in:
parent
6d3a56420e
commit
af48f588c9
@ -90,6 +90,7 @@ int32_t srf08_get_distances(uint32_t *range_array, uint8_t ranging_mode)
|
||||
uint8_t tx_buff[reg_size];
|
||||
uint8_t register_location;
|
||||
uint8_t echo_number = 0;
|
||||
uint8_t echo_number = 0;
|
||||
|
||||
tx_buff[0] = ranging_mode;
|
||||
status = i2c_write(SRF08_I2C_INTERFACE, SRF08_DEFAULT_ADDR,
|
||||
@ -109,6 +110,7 @@ int32_t srf08_get_distances(uint32_t *range_array, uint8_t ranging_mode)
|
||||
//read the high echo byte
|
||||
status = i2c_read(SRF08_I2C_INTERFACE, SRF08_DEFAULT_ADDR,
|
||||
register_location, rx_buff, reg_size);
|
||||
echo_number++;
|
||||
|
||||
if (!status) {
|
||||
puts("Read the the high echo byte from the i2c-interface is \
|
||||
|
Loading…
Reference in New Issue
Block a user