Firmware-75 Function-117

From I-CubeX Wiki
Revision as of 13:37, 13 October 2017 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

REACHCLOSED (117, 75h)

The ReachCloseD function enables output of the ReachCloseD sensor data in both host and stand-alone mode. In host mode the sensor data is output in I2C DATA messages. In stand-alone mode the sensor data is output according to the stand-alone mode settings of the input number that equals the I2C port number. There are the following methods to select, using the FUNCTION command’s method/parameter FP:

ReachCloseD v1.0

FP Data output in host mode Data output in stand-alone mode
default Distance [0..2048]; an unsigned 16-bit value, representing [0..2048] mm, sent as nibbles in four bytes (MSB .. LSB) Distance [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [0..2048] mm, sent as one or two bytes (LSB, MSB)
1 Distance [0..2048]; an unsigned 16-bit value, representing [0..2048] mm, sent as nibbles in four bytes (MSB .. LSB) Distance [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [0..2048] mm, sent as one or two bytes (LSB, MSB)
2 Distance [0..2048]; an unsigned 16-bit value, representing [0..2048] mm, sent as nibbles in four bytes (MSB .. LSB) Distance [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [0..1024] mm, sent as one or two bytes (LSB, MSB)
3 Distance [0..2048]; an unsigned 16-bit value, representing [0..2048] mm, sent as nibbles in four bytes (MSB .. LSB) Distance [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, representing [0..1024] mm, sent as one or two bytes (LSB, MSB)

Methods 1 and 3 measure with higher accuracy than methods 0 and 2. To achieve this the measurement takes about 200 ms whereas the lower accuracy methods 0 and 2 take about 20 ms. See the ReachCloseD v1.0 webpage for more details.

Example:

In order to enable the ReachCloseD function to get the object distance from a ReachCloseD sensor with I2C device address 41 (default ReachCloseD I2C device address) connected to the 7th I2C port, the following message is sent:

240, 125, 0 {DEV}, 8 {FUNCTION}, 6 {yyy = 6}, 41 {device address}, 117 {ReachCloseD function}, 0 {Long range / low accuracy distance method}, 247 (F0h, 7Dh, 00h, 08h, 06h, 29h, 75h, 00h, F7h)

In host mode raw sensor data will be output immediately in I2C DATA messages. In stand-alone mode a suitable configuration has to be set using the EDIT CONFIG command before any MIDI messages will be output.

Other settings of the ReachCloseD sensor can be effectuated by using I2C commands such as I2C WRITE and I2C READ. See also the datasheet linked from the ReachCloseD v1.0 webpage.