User`s guide
XBee Analog I/O Adapter
25
Use xbeeain.py functions in Python programs
To use the functions in the module xbeeain.py, any Python programs must
contain the next statement:
from xbeeain import *
The functions and arguments in module xbeeain.py are as follows.
############################################################################
# #
# Class XBeeAIN #
# #
############################################################################
# #
# This class derives from the base XBeeDevice class, and implements #
# the Analog IO layer of the Digi XBee Analog IO Adapter. #
# #
############################################################################
# #
# Functions: #
# #
# configure(channel, mode) - Define channel usage #
# channel - Channel number to be configured. #
# mode - One of (CurrentLoop, TenV, Differential) #
# #
# raw_sample(channel) #
# channel - Channel number to be read. #
# Returns raw analog sample data for specified channel #
# #
# sample(channel) #
# channel - Channel number to be read. #
# Returns sensor data scaled appropriately for operating mode #
# #
# power(onoff) - Toggles Power Output on Terminal 6. #
# onoff - Specifies Power Output either on (1) or off (0). #
# #
############################################################################
Additional programming resources
For further information on writing Python programs and using Python
functions, see:
• Digi Python Programming Guide
http://ftp1.digi.com/support/documentation/90000833_b.pdf
• The Python Support Forum on digi.com
http://www.digi.com/support/forum/forum.jspa?forumID=104
For more information about AT commands, see:
• XBee ZNet 2.5 (Series 2) RF Module data sheet
http://www.digi.com/pdf/ds_xbeemodules.pdf
• XBee ZNet 2.5 (Series 2) RF Module Product Manual
http://ftp1.digi.com/support/documentation/90000866_A.pdf