1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 10:32:44 +01:00

SRF08 driver, updated rangig function getting the number of echos

This commit is contained in:
Zakaria Kasmi 2013-09-02 12:36:15 +02:00 committed by Oleg Hahm
parent 6d3a56420e
commit af48f588c9

View File

@ -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 \