O'Reilly logo

Building Wireless Sensor Networks by Robert Faludi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

AT Configuration I/O Commands

To configure the XBee radio for direct input, output, or both, you’ll use a set of AT commands that select each pin’s mode and the sample rate for sending the data. There are several steps involved in getting this done, so read carefully through this section at least once before starting to configure your radio.

Here’s the basic I/O command set:

ATD0...ATD7

Configures pins 0 through 7 for I/O mode (pins 8 and 9 are not supported in the current firmware version). The number after the D indicates which pin you’ll be configuring. The command is followed by a numeric code that indicates whether the pin is tasked with digital input, output, analog input (pins 0 to 3 only), some other function, or nothing at all. For example, to configure I/O pin 2 as a digital input (code 3), the command would be ATD23. See the I/O settings codes in Table 4-3 for a complete list of the codes.

ATP0...ATP2

Configures pins 10 11, and 12 for I/O mode (there’s a P3 for pin 13, but it is not supported in the current firmware). Again, the number after the P indicates which pin you’ll be configuring, and is followed by a numeric code to indicate what purpose the pin will serve—digital in, digital out, or nothing. For example, to configure I/O pin 11 as a high digital output (code 5) the command would be ATP15. Pins 10-12 do not support any analog functions.

ATIR

This sets the I/O sample rate—how frequently to report the current pin state and transmit it to the destination address. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required