Firmware-811 Function-110

From I-CubeX Wiki
Jump to: navigation, search

LIGHT2D (110, 6Eh)

The LIGHT2D function enables output of the Light2D 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. The following methods can be selected using the FUNCTION command’s method/parameter FP:

Light2D v1.0

FP Data output in host mode Data output in stand-alone mode
1 Visible Illumination Level [0..5047]; an unsigned 16-bit value sent nibbles in four bytes (MSB .. LSB) Visible Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
2 IR Illumination Level [0..5047]; an unsigned 16-bit value sent as nibbles in four bytes (MSB, LSB) IR Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
3 Full-Spectrum Illumination Level [0..5047]; an unsigned 16-bit value sent as nibbles in four bytes (MSB, LSB) Full-Spectrum Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
4 Lux [0..40000]; an unsigned 16-bit value, where 1000 represents 1000 Lux, sent as nibbles in four bytes (MSB, LSB) Lux [0..127] or [0..16383]; an unsigned 7-bit, where 1000 Lux is represented as 1000 x 0.4 / 128 = 3, or 14-bit value, where 1000 Lux is represented as 1000 x 0.4 = 400, sent as one or two bytes (LSB, MSB)
0, 5, 6, 7, 8, 9 Visible, IR, Full-Spectrum Illumination Level and Lux [0..37177]; an unsigned 16-bit value sent nibbles in four bytes (MSB .. LSB) Visible, IR, Full-Spectrum Illumination Level and Lux [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
11 Visible Illumination Level [0..37177]; an unsigned 16-bit value sent nibbles in four bytes (MSB .. LSB) Visible Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
12 IR Illumination Level [0..37177]; an unsigned 16-bit value sent as nibbles in four bytes (MSB, LSB) IR Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
13 Full-Spectrum Illumination Level [0..37177]; an unsigned 16-bit value sent as nibbles in four bytes (MSB, LSB) Full-Spectrum Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
14 Lux [0..40000]; an unsigned 16-bit value, where 1000 represents 1000 Lux, sent as nibbles in four bytes (MSB, LSB) Lux [0..127] or [0..16383]; an unsigned 7-bit, where 1000 Lux is represented as 1000 x 0.4 / 128 = 3, or 14-bit value, where 1000 Lux is represented as 1000 x 0.4 = 400, sent as one or two bytes (LSB, MSB)
10, 15, 16, 17, 18, 19 Visible, IR, Full-Spectrum Illumination Level and Lux [0..65535]; an unsigned 16-bit value sent nibbles in four bytes (MSB .. LSB) Visible, IR, Full-Spectrum Illumination Level and Lux [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
21 Visible Illumination Level [0..65535]; an unsigned 16-bit value sent nibbles in four bytes (MSB .. LSB) Visible Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
22 IR Illumination Level [0..65535]; an unsigned 16-bit value sent as nibbles in four bytes (MSB, LSB) IR Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
23 Full-Spectrum Illumination Level [0..65535]; an unsigned 16-bit value sent as nibbles in four bytes (MSB, LSB) Full-Spectrum Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
24 Lux [0..40000]; an unsigned 16-bit value, where 1000 represents 1000 Lux, sent as nibbles in four bytes (MSB, LSB) Lux [0..127] or [0..16383]; an unsigned 7-bit, where 1000 Lux is represented as 1000 x 0.4 / 128 = 3, or 14-bit value, where 1000 Lux is represented as 1000 x 0.4 = 400, sent as one or two bytes (LSB, MSB)
20, 25, 26, 27, 28, 29 Visible, IR, Full-Spectrum Illumination Level and Lux [0..5047]; an unsigned 16-bit value sent nibbles in four bytes (MSB .. LSB) Visible, IR, Full-Spectrum Illumination Level and Lux [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
31 Visible Illumination Level [0..5047]; an unsigned 16-bit value sent nibbles in four bytes (MSB .. LSB) Visible Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
32 IR Illumination Level [0..5047]; an unsigned 16-bit value sent as nibbles in four bytes (MSB, LSB) IR Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
33 Full-Spectrum Illumination Level [0..5047]; an unsigned 16-bit value sent as nibbles in four bytes (MSB, LSB) Full-Spectrum Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
34 Lux [0..40000]; an unsigned 16-bit value, where 1000 represents 1000 Lux, sent as nibbles in four bytes (MSB, LSB) Lux [0..127] or [0..16383]; an unsigned 7-bit, where 1000 Lux is represented as 1000 x 0.4 / 128 = 3, or 14-bit value, where 1000 Lux is represented as 1000 x 0.4 = 400, sent as one or two bytes (LSB, MSB)
30, 35, 36, 37, 38, 39 Visible, IR, Full-Spectrum Illumination Level and Lux [0..37177]; an unsigned 16-bit value sent nibbles in four bytes (MSB .. LSB) Visible, IR, Full-Spectrum Illumination Level and Lux [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
41 Visible Illumination Level [0..37177]; an unsigned 16-bit value sent nibbles in four bytes (MSB .. LSB) Visible Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
42 IR Illumination Level [0..37177]; an unsigned 16-bit value sent as nibbles in four bytes (MSB, LSB) IR Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
43 Full-Spectrum Illumination Level [0..37177]; an unsigned 16-bit value sent as nibbles in four bytes (MSB, LSB) Full-Spectrum Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
44 Lux [0..40000]; an unsigned 16-bit value, where 1000 represents 1000 Lux, sent as nibbles in four bytes (MSB, LSB) Lux [0..127] or [0..16383]; an unsigned 7-bit, where 1000 Lux is represented as 1000 x 0.4 / 128 = 3, or 14-bit value, where 1000 Lux is represented as 1000 x 0.4 = 400, sent as one or two bytes (LSB, MSB)
40, 45, 46, 47, 48, 49 Visible, IR, Full-Spectrum Illumination Level and Lux [0..65535]; an unsigned 16-bit value sent nibbles in four bytes (MSB .. LSB) Visible, IR, Full-Spectrum Illumination Level and Lux [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
51 Visible Illumination Level [0..65535]; an unsigned 16-bit value sent nibbles in four bytes (MSB .. LSB) Visible Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
52 IR Illumination Level [0..65535]; an unsigned 16-bit value sent as nibbles in four bytes (MSB, LSB) IR Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
53 Full-Spectrum Illumination Level [0..65535]; an unsigned 16-bit value sent as nibbles in four bytes (MSB, LSB) Full-Spectrum Illumination Level [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
54 Lux [0..40000]; an unsigned 16-bit value, where 1000 represents 1000 Lux, sent as nibbles in four bytes (MSB, LSB) Lux [0..127] or [0..16383]; an unsigned 7-bit, where 1000 Lux is represented as 1000 x 0.4 / 128 = 3, or 14-bit value, where 1000 Lux is represented as 1000 x 0.4 = 400, sent as one or two bytes (LSB, MSB)
50, 55, 56, 57, 58, 59 Visible, IR, Full-Spectrum Illumination Level and Lux [0..5047]; an unsigned 16-bit value sent nibbles in four bytes (MSB .. LSB) Visible, IR, Full-Spectrum Illumination Level and Lux [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)

Methods 0-29 are intended for bright lighting whereas methods 30-60 set the sensor's gain to 16 and are intended for low-light conditions.

Example:

In order to enable the LIGHT2D function to get all sensor data from a Light2D sensor with I2C device address 57 (default Light2D I2C device address) connected to the 7th I2C port, the following message is sent:

240, 125, 0 {DEV}, 8 {FUNCTION}, 6 {port}, 57 {device address}, 110 {LIGHT2D function}, 0 {all parameters}, 247 (F0h, 7Dh, 00h, 08h, 06h, 39h, 6Eh, 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 Light2D sensor can be effectuated by using I2C commands such as I2C WRITE and I2C READ.