Displaying the received data to the serial monitor

I’m using the XBee Explorer from SparkFun which is connected to the
computer as our transmitter. And for my receiver, I have another
xbee (Xbee Pro Series 1) and its shield hooked up to the Arduino Mega.

I’m trying to get the transmitted packet displayed on the Arduino
serial monitor after it gets received by the receiver. I’m using the Series1_RX code from Andrew Rapp, but I’ve added the following print commands in their respective RX_16 and RX_64 function statements.


in order to print directly to the serial monitor. But when I just compile this code, I get the following error: “error: call of overloaded ‘println(uint8_t*)’ is ambiguous”.

Please how can I fix this?

The full code is:

#include <XBee.h>

XBee xbee = XBee();
XBeeResponse response = XBeeResponse();
// create reusable response objects for responses we expect to handle 
Rx16Response rx16 = Rx16Response();
Rx64Response rx64 = Rx64Response();

int statusLed = 11;
int errorLed = 12;
int dataLed = 10;

uint8_t option = 0;
uint8_t data = 0;

void flashLed(int pin, int times, int wait) {
    for (int i = 0; i < times; i++) {
      digitalWrite(pin, HIGH);
      digitalWrite(pin, LOW);
      if (i + 1 < times) {

void setup() {
  pinMode(statusLed, OUTPUT);
  pinMode(errorLed, OUTPUT);
  pinMode(dataLed,  OUTPUT);
  // start serial
  flashLed(statusLed, 3, 50);

// continuously reads packets, looking for RX16 or RX64
void loop() {
    if (xbee.getResponse().isAvailable()) {
      // got something
      if (xbee.getResponse().getApiId() == RX_16_RESPONSE || xbee.getResponse().getApiId() == RX_64_RESPONSE) {
        // got a rx packet
        if (xbee.getResponse().getApiId() == RX_16_RESPONSE) {
              option = rx16.getOption();
              data = rx16.getData(0);
        } else {
              option = rx64.getOption();
              data = rx64.getData(0);
        // TODO check option, rssi bytes    
        flashLed(statusLed, 1, 10);
        // set dataLed PWM to value of the first byte in the data
        analogWrite(dataLed, data);
      } else {
            // not something we were expecting
        flashLed(errorLed, 1, 25);    

Never mind, I got it fixed by including this for loop:

for (int i=0; i< rx64.getDataLength(); i++)
                  Serial.print(rx64.getData(i), HEX);