Sections
You are here: Home Documentation Tutorials XBee Wireless Interface IO Configuration

IO Configuration

Configure the input/output capabilities of an XBee module.

There are 9 IO pins on the XBee module, abeled AD0-AD6, DIO7 and DI8.  AD0 - AD6 can be set as digital or analog inputs, DIO7 can be a digital in or out, and DI8 can only act as a digital in.

Pins can be set to one of 5 values:

  • 0 - Disabled
  • 2 - Analog Input
  • 3 - Digital Input
  • 4 - Digital Out High/On
  • 5 - Digital Out Low/Off

In OSC, use the /xbeeconfig/io properties to do this - just append the number of the input pin onto the io part of the message.  For example, to configure AD4 as an analog in, we'd send the message

/xbeeconfig/io4 2

Note that we added the 4 on the end of io and used 2 to specify that it should be an analog in. 

To do this in firmware check the XBeeConfig_SetIO( ) function.

Sample Rate

If an XBee module's sample rate is set to anything greater than 0, it will read all its input pins at that rate and send a message with the values.  Once you turn the sample rate on, properly addressed modules will receive IO packets from that module.  To set the sample rate to once every 10 milliseconds via OSC, send the message

/xbeeconfig/samplerate 10


To do this in firmware check the XBeeConfig_SetSampleRate( ) function. 

Once you've set some values, try reading them back to make sure you can communicate successfully with the module.  If this doesn't even work, go back and check your work - bad connections are always a likely suspect.

As was previously mentioned, there are all sorts of additional configuration options for the XBee modules.  It's not practical to reproduce the entire manual in this tutorial, but you can download it from our datasheets section

 
Log in


Forgot your password?
New user?