The Mayfly has two serial UART ports. They are designated 0 and 1, and can also be referred to as TXD0/RXD0 or TXD1/RXD1. When using them in an Arduino sketch, one is called “Serial” and the other is called “Serial1”.
The default Xbee port is to TXD1/RXD1, which you can access by using the “Serial1” commands. You can change the default settings by cutting the traces on SJ8 and SJ9 and adding a solder jumper to connect the Xbee to UART0, but be aware that it can cause conflicts with the computer since UART0 is what is used by the IDE to program the board. Only change these jumper settings if you take precautions to not have communications to or from the Xbee while the Mayfly is connected to a computer.
The following sketch is an example of how you can print out text to the serial terminal (UART 0) and then to the Xbee port (UART 1). It uses a baud rate of 9600 for the Xbee port since that’s the default address of most Xbee modules.
Serial.begin(57600); //Start the serial connection with the computer (UART-0)
Serial1.begin(9600); //this is the Mayfly's default Xbee port (UART-1)
Serial.println("This is Serial Data printed to the computer");
Serial1.print("This is Serial Data sent to the Xbee port");