1818 */
1919
2020#include < XBee . h>
21- #include < NewSoftSerial . h>
21+ #include < SoftwareSerial . h>
2222
2323/*
2424This example is for Series 2 (ZigBee) XBee Radios only
2525Receives I/O samples from a remote radio.
2626The remote radio must have IR > 0 and at least one digital or analog input enabled.
2727The XBee coordinator should be connected to the Arduino.
2828
29- This example uses the NewSoftSerial library to view the XBee communication. I am using a
29+ This example uses the SoftSerial library to view the XBee communication. I am using a
3030Modern Device USB BUB board (http://moderndevice.com/connect) and viewing the output
31- with the Arduino Serial Monitor.
32- You can obtain the NewSoftSerial library here http://arduiniana.org/libraries/NewSoftSerial/
31+ with the Arduino Serial Monitor.
3332*/
3433
3534// Define NewSoftSerial TX/RX pins
36- // Connect Arduino pin 9 to TX of usb-serial device
37- uint8_t ssRX = 9 ;
38- // Connect Arduino pin 10 to RX of usb-serial device
39- uint8_t ssTX = 10 ;
35+ // Connect Arduino pin 8 to TX of usb-serial device
36+ uint8_t ssRX = 8 ;
37+ // Connect Arduino pin 9 to RX of usb-serial device
38+ uint8_t ssTX = 9 ;
4039// Remember to connect all devices to a common Ground: XBee, Arduino and USB-Serial device
41- NewSoftSerial nss(ssRX, ssTX);
40+ SoftwareSerial nss(ssRX, ssTX);
4241
4342XBee xbee = XBee ();
4443
@@ -47,7 +46,8 @@ ZBRxIoSampleResponse ioSample = ZBRxIoSampleResponse();
4746XBeeAddress64 test = XBeeAddress64 ();
4847
4948void setup () {
50- xbee. begin(9600 );
49+ Serial . begin(9600 );
50+ xbee. setSerial(Serial );
5151 // start soft serial
5252 nss. begin(9600 );
5353}
0 commit comments