
Copyright © Terabee 2016
Reading the distance is done by sending 0x61 (this is the 7 bit address 0x30 followed by the
read bit '1') followed by three byte read operations. The first two bytes you receive are a 16
bit word containing the latest measurement in mm, the third byte is the CRC8 checksum.
Writing commands to the TeraRanger One:
1. Send the address byte consisting of a 7 bit base address and the last bit indicating
write (‘0’), e.g. 0x60 for base address 0x30. All commands listed in the table below
are write operations, the answer will be in the next read operation for which you have
to send the 7 bit address with the read bit set.
2. Send the desired command listed in the table below.
3. In case the command creates an answer, read it back immediately.
Reading data from the TeraRanger One:
1. Send the address byte consisting of 7 bit base address and the last bit indicating
read (‘1’), e.g. 0x61 for base address 0x30.
2. Read back the the number of bytes imposed by the command, e.g. three bytes for a
distance reading.
Command in
hexadecimal
Command name
Command explanation
0x01
WHO_AM_I
Write this value to TROne via I2C and the
next distance reading will contain 0xA1 in
the first byte (ignore others). You can use
this function to uniquely identify a
TeraRanger One on the I2C bus.
0xA2
CHANGE_BASE_ADDR
Command to change base address of the
TeraRanger One. Write this value
followed by new address to set, e.g. send
0x42 if you want base address 0x42,
ignore read/write bits.
After sending this command, power cycle
the device. Afterwards it will join the I2C
bus as a slave on the new address.
Please note that the default modes when shipped are “Precise” with “Binary” output for
sensor type A and “Optimal” with “Binary” output for sensor type B (refer to section 5.1 for
the description of the modes). The operating modes for the I2C interface are set by default.
6
How to connect to Pixhawk autopilot
90 Rue Henri Fabre
Website:
01630 St. Genis‐Pouilly
Technical support:
France (next to CERN)
Commercial:
www.teraranger.com
[email protected]
[email protected]
14