User`s guide
XBee Analog I/O Adapter
24
Python modules for configuring inputs and outputs
Digi provides a library of Python modules for configuring inputs and outputs
on the adapter and retrieving data from the adapter. These modules are
available for downloading from www.digi.com/din/docs, in a file named
XBee Adapter Libraries. By uploading these Python modules to the
gateway that serves as a coordinator for the adapter, you can use them in
your own programs.
Python module descriptions
The Python modules in the XBee Adapter Libraries that are relevant to
programming the XBee Analog I/O Adapter are:
Upload Python modules to gateway
1. Go to www.digi.com/din/docs.
2. In the list of downloadable files, select and download file
XBee Adapter Libraries.
3. Unzip the downloaded file.
4. Read the readme file.
5. Open the web interface for the gateway, go to Applications > Python.
6. In the Upload File edit box, enter the file name for the
XBee Adapter Libraries, DigiXBeeDrivers.zip, using the Browse
button as needed, and click Upload.
Use Python modules in programs
To use the Python modules in the XBee Adapter Libraries in programs that
you develop, append this statement:
sys.path.append("WEB/python/DigiXBeeDrivers.zip")
Module Description
xbeeprodid.py Contains calls to determine the type of adapter; (Analog,
Digital, Sensor, RS-232, etc.)
xbeedevice.py Implements a base class of any XBee device on the ZigBee
network.
xbeeain.py Configures analog mode, issues AT commands to retrieve
data from the adapter, including raw analog sample data
and sensor data scaled appropriately for operating mode,
and toggles power on/off on terminal 6. Functions and
arguments are shown on page 25.
This module derives an AIO (analog input/output) class from
the base class of any XBee device on the ZigBee network.
That is, module xbeeain.py uses xbeedevice.py internally.
sensor_io.py Decodes the output of the AT IS command.