User Manual
XBee® Wi-Fi RF Modules
© 2012 Digi International, Inc. 48
default. The analog inputs on the module are capped at 0x3FF. Analog samples are
returned in order starting with AD0 and finishing with AD4. Only enabled analog input
channels return data as shown in the example below.
To convert the A/D reading to mV, do the following:
AD (mV) = (A/D reading (converted to decimal) * VREF) / 1023 where VREF may be 1250 or 2500
Assuming that AV is set to the default value, the reading in the sample frame represents
voltage inputs of 2385.14 mV (0x3D0) and 713.59 mV (0x124) for AD0 and AD1
respectively.
Queried Sampling
The IS command can be sent to a device locally, or to a remote device using the API
remote command frame (see chapter 8 for details). When the IS command is sent and at
least one I/O line is enabled as an input or an output, the receiving device samples all
enabled digital I/O and analog input channels and returns an I/O sample. When no I/O
line is enabled, IS will return nothing. If IS is sent locally, the I/O sample is sent out the
UART or SPI port. If the IS command was received as a remote command, the I/O sample
is sent over-the-air to the device that sent the IS command.
If the IS command is issued in command mode, the module returns a carriage return-
delimited list containing the above-listed fields. If the IS command is issued in API mode,
the module returns an API command response packet with the I/O data included in the
command data portion of the response frame.
The following table shows an example of the fields in an IS response.
Example Sample AT Response
0x01 [1 sample set]
0x0C0C
[Digital Inputs: DIO 2, 3, 10, 11 selected]
0x03 [Analog Inputs; A/D 0,1]
0x0408 [Digital input states: DIO 3,10 high, DIO 2,11 low]
0x03D0
[Analog input ADIO 0=0x3D0]
0x0124
[Analog input ADIO 1=0x120]
Periodic I/O Sampling
Periodic sampling allows the XBee module to take an I/O sample and transmit it to a
remote device at a periodic rate. The periodic sample rate is set by the IR command. If
IR is set to 0 or there are no active I/O lines, periodic sampling is disabled. For all other
values of IR, data will be sampled after IR milliseconds have elapsed and transmitted to
a remote device. However, the module cannot keep up with transmitting an I/O sample
more often than every three milliseconds. Therefore, when IR is set to 1 or 2, many
samples are lost. The DL command determines the destination address of the I/O
samples. DL can be set to transmit to a network client or another XBee Wi-Fi module.
Only modules with API mode enabled for the serial port can send I/O data samples out