Firmware-830 Command-004

From I-CubeX Wiki
Revision as of 03:26, 1 May 2023 by Admin (talk | contribs) (SAMPLE (4, 04h))
Jump to: navigation, search

SAMPLE (4, 04h)

The SAMPLE command provides a single snapshot of the data sampled from one port or all ports, whether configured for an analog sensor or a digital (I2C) sensor. Upon completion of the command the WiDig sends out the SAMPLE DATA message (for analog sensors) or I2C DATA message (for digital sensors), whether in host or stand-alone mode. In stand-alone mode, data from adjacent higher-numbered inputs in ghost mode will also be output. In host mode, if an analog sensor processing function is enabled and its output value is greater than 1023 (eg. in the case of lookup tables), it will be output as value 1024.

The [BODY] of the SAMPLE command is composed of one byte - the sensor input number:

0000xyyy: x = 1; apply the command to all ports (yyy is ignored), ie. send 8 messages with the sensor data for each port
yyy = [0..7]; ports, where the first port number = 0, and the last (8th) port number = 7

Example:

In order to sample port 5, the following message is sent:

240, 125, 0 {DEV}, 4 {SAMPLE}, 4 {yyy}, 247 (F0h, 7Dh, 00h, 04h, 04h, F7h)