Difference between revisions of "Firmware-830 Message-000"

From I-CubeX Wiki
Jump to: navigation, search
(STREAM DATA (0, 00h))
 
Line 29: Line 29:
 
|-
 
|-
 
|00xzzz00:
 
|00xzzz00:
|zzz = 0; the 3 least significant bits
+
|zzz = 32; the 3 least significant bits
 
|-
 
|-
 
|
 
|

Latest revision as of 18:45, 17 December 2023

STREAM DATA (0, 00h)

In host mode the WiDig sends analog sensor input values, after being activated through a STREAM command, in the STREAM DATA message.

The [BODY] of the STREAM DATA message contains a list of sensor values from all active (turned on) sensors, in ascending order. Inactive sensors are not included in the list. If an analog sensor processing function is enabled and its output is greater than 1023 (eg. in the case of lookup tables), it will be output as value 1024 in host mode (it would be skipped in stand-alone mode). Both 7-bit and 10-bit sensor values are packed together - 10-bit values are sent using two bytes, where the first byte contains the first 7 bits of the sensor value and the second byte contains the last 3 bits of the sensor value:

7-bit lo-res mode

0yyyyyyy: yyyyyyy = [0..127]; the most significant bits

10-bit hi-res mode

0yyyyyyy: yyyyyyy = [0..127]; the most significant bits
000zzz00: zzz = [0..7]; the 3 least significant bits

Skip value

0yyyyyyy: yyyyyyy = 127; the most significant bits
00xzzz00: zzz = 32; the 3 least significant bits
x = 1; don't output value in stand-alone mode

Example:

The WiDig has sensor input 1 turned on in lo-res mode (7-bit), sensor input 5 turned on in hi-res mode (10-bit), and sensor input 8 turned on in lo -res mode (7-bit). All other sensor inputs are turned off. The WiDig acquires the value 100 (sensor input 1), 1001 (sensor input 5), and 21 on (sensor input 8). The WiDig sends the following message:

240, 125, 0 {DEV}, 0 {STREAM DATA}, 100 {yyyyyyy of sensor input 1}, 125 {yyyyyyy of sensor input 5}, 8 {zzz00 of sensor input 5}, 21 {yyyyyyy of sensor input 8}, 247 (F0h, 7Dh, 00h, 00h, 64h, 7Dh, 08h, 15h, F7h)

The sampled value from sensor input 5 is 125 * 8 (i.e. 3 bit left shift) + 8 / 8 (i.e. 2 bit right shift) = 1001