Difference between revisions of "Firmware-73 Command-004"

From I-CubeX Wiki
Jump to: navigation, search
(Created page with "==SAMPLE (4, 04h)== The SAMPLE command provides a snapshot of the data coming out of a single sensor input. Upon completion of the command the USB-microDig sends out the Fi...")
 
 
Line 1: Line 1:
 
==SAMPLE (4, 04h)==
 
==SAMPLE (4, 04h)==
  
The SAMPLE command provides a snapshot of the data coming out of a single sensor input. Upon completion of the command the USB-microDig sends out the [[Firmware-73_Message-004 |SAMPLE DATA message]], whether in host or stand-alone mode.
+
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 USB-microDig sends out the [[Firmware-73_Message-004 |SAMPLE DATA message]], whether in host or stand-alone mode.
  
 
The [BODY] of the SAMPLE command is composed of one byte - the sensor input number:
 
The [BODY] of the SAMPLE command is composed of one byte - the sensor input number:
  
 
{|
 
{|
|00000yyy:
+
|0000xyyy:
|yyy = [0..7]; sensor input number, where the first sensor input number = 0, and the last (8th) sensor input number = 7
+
|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:
 
Example:
  
In order to sample sensor input 5 (provided it is turned off), the following message is sent:
+
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)
 
:240, 125, 0 {DEV}, 4 {SAMPLE}, 4 {yyy}, 247 (F0h, 7Dh, 00h, 04h, 04h, F7h)

Latest revision as of 04:41, 20 November 2016

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 USB-microDig sends out the SAMPLE DATA message, whether in host or stand-alone mode.

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)