Using xbee software serial port with redbot

Hello !

I have bought the redbot and a couple of xbees from sparkfun. I want to use the xbees to control the robot remotely.

  • the robot motors with a sample sketch work fine, with the redbot library.

  • the xbees work fine with the arduino xbee library. In API mode, I can send messages from the PC to the robot.

I use xbee’s software serial through SoftwareSerial.h, and I can specify the correct pins on the redbot, like this :

SoftwareSerial nss(15, 14); // RX, TX

Trouble is, if I add RedBot.h to my sketch, it doesn’t compile anymore, presumably because it has its own “RedBotSoftwareSerial”. However, as documented, “RedBotSoftwareSerial” does not let me choose the PINs I need.

(“You no longer have a choice of which pins to use–the library always uses A0 and A1, which are the pins connected to the XBee module footprint.”)

How could I work around this ?

Regards,

alex

So, why not use the RedBot library’s RedBotSoftwareSerial instead of ordinary SoftwareSerial? The pins A0 and A1 are hardwired for the Xbee socket anyway. And it’s library seems to be hardcoded for that reason. So there is no point in specifying (other) pins.

Right ! I didn’t understand the documentation, sorry for the noise.

Indeed just switching to RedBotSoftwareSerial and not specifying the pins worked just fine, as you said.