Firmware-75 Function-121

From I-CubeX Wiki
Jump to: navigation, search

MOIST3D (121, 79h)

The Moist3D function enables output of the Moist3D 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:

Moist3D v1.0

FP Data output in host mode Data output in stand-alone mode
1 Soil Moisture [0..512]; an unsigned 16-bit value sent nibbles in four bytes (MSB .. LSB) Soil Moisture [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
2 Illumination [0..65536]; an unsigned 16-bit value sent as nibbles in four bytes (MSB, LSB) Illumination [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
3 Temperature [0..512]; an unsigned 16-bit value, where 512 represents 51.2 degrees Celsius, sent as nibbles in four bytes (MSB, LSB) Temperature [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value, where 127 or 16383 represents 51 degrees Celsius, sent as one or two bytes (LSB, MSB)
4 Soil Moisture, Illumination, Temperature; unsigned 16-bit values each sent as nibbles in four bytes (MSB, LSB) Soil Moisture, Illumination, Temperature; unsigned 7-bit or 14-bit values, representing physical values as above, sent as one or two bytes (LSB, MSB)

There are no calibration factors available for the Soil Moisture and Illumination values, ie. it is not known what is represented by each value.


Example:

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

240, 125, 0 {DEV}, 8 {FUNCTION}, 6 {yyy = 6}, 32 {device address}, 121 {Moist3D function}, 4 {all parameters}, 247 (F0h, 7Dh, 00h, 08h, 06h, 20h, 79h, 04h, 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 Moist3D sensor can be effectuated by using I2C commands such as I2C WRITE and I2C READ.