Xbee and NewSoftSerial

Hey guys and girls,
Can I use NewSoftSerial library with my xbee transceiver instead of tx and rx pins 0 & 1 on the Arduino Duemilanove to read AND write to the Xbee board? Any one get this library to work with the Xbee transceiver?

Thanks
Rico Bravo

Yes, yes and yes.

I'm working on a project that using 2 Arduino/Xbee pairs and both are using NewSoftSerial for the bi-directional communication to/from the Xbees.

Also, Does NewSoftSerial have a flush() method???
Example:

NewSoftSerial Xbee(8,9);

Can I do:
Xbee.flush();

I believe the developer (mikalhart) is planning to add that.

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1233298805/82#82

In the meantime it's trivial to implement it yourself with:

void MyFlush() {
  while (Xbee.available() > 0)
    char c = Xbee.read();
}

Just call MyFlush() anytime you want to flush the Xbee buffer.

That's right. Thanks, etracer. FWIW, the highest priority items for the next NewSoftSerial are:

  1. 8MHz support
  2. flush()

Other features on the horizon are:

  1. Support for inverted logic
  2. (possibly) RTS/CTS flow control support
  3. (possibly) 20MHz support

Mikal