I'm trying to get the LidarLite laser range finder to work with my Labjack UE9. This range finder outputs the distance measurement on two bytes via an I2C bus.
I'm therefore using the low level command for I2C read. As suggested in the LidarLite's documentation ( http://kb.pulsedligh...ick-start-guide ), I'm first sending a command contaning two data bytes : 0x00 and 0x04, the first being the register to write, and the second the value to write, corresponding to an request for a measurement cycle.
Then, and it's where it gets tricky, I have to read the measured value. The guide suggests to either read the high byte in a first register (0x0f), and the low byte in an other register (0x10), or to perform a 2-byte read on register 0x8f.
I successfully realized the first method, by sending a first I2C command containing a single byte (0x0f, the first register address), reading the response containing the high byte, then sending a second I2C command containing the second register address and reading the low byte in the response.
Problem is, I can't do this to quickly to avoid overpolling the I2C bus, so I'd really like to use the second method, and read the 2 bytes in a single call. But, when I tried to build an I2C command asking to read 2 bytes, and containing only 0x8f as command byte, I only get the low byte of the measurement in return, and a second value that does'nt make sense.
Is there a way to specify that I want a two byte read starting from a specific register? Because on Arduino, there is a dedicated function taking as argument the register to read from, and the number of bytes to read...