Firmware-72 Function-121
MOIST (121, 79h)
The Moist function enables output of the Moist 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. Since the Moist has multiple output parameters, the stand-alone mode settings are incremented by one for each extra output parameter. The following methods can be selected using the FUNCTION command’s method/parameter FP:
Moist v1.0
FP | Data output in host mode | Data output in standalone mode |
---|---|---|
1 | Soil Moisture [0..512]; an unsigned 16-bit value sent as two 8-bit bytes (MSB, LSB) | Soil Moisture [0..127] or [0..16384]; an unsigned 7-bit or 14-bit value sent as one or two 8-bit bytes (LSB, MSB) |
2 | Illumination [0..65536]; an unsigned 16-bit value sent as two 8-bit bytes (MSB, LSB) | Illumination [0..127] or [0..16384]; an unsigned 7-bit or 14-bit value sent as one or two 8-bit bytes (LSB, MSB) |
3 | Temperature [0..512]; an unsigned 16-bit value, where 512 represents 51.2 degrees Celsius, sent as two 8-bit bytes (MSB, LSB) | Temperature [0..127] or [0..16384]; an unsigned 7-bit or 14-bit value, where 127 or 16383 represents 51 degrees Celsius, sent as one or two 8-bit bytes (LSB, MSB) |
4 | Soil Moisture, Illumination, Temperature; unsigned 16-bit values each sent as two 8-bit bytes (MSB, LSB) | Soil Moisture, Illumination, Temperature; unsigned 7-bit or 14-bit values, representing physical values as above, sent as one or two 8-bit 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 Moist sensor with I2C device address 32 (default Moist 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 {Moist 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. The sensor parameter’s raw values as output in a I2C DATA message are offset and scaled so as to fit in the channel voice MIDI value range of either 0-127 (eg. control-change message) or 0-16383 (pitch-bend message).
Other settings of the Moist sensor can be effectuated by using I2C commands such as I2C WRITE and I2C READ.