Xbee on Arduino

295 views
Skip to first unread message

Mersing

unread,
Mar 30, 2009, 10:17:43 AM3/30/09
to xbee-api
Hello Andrew,

I'm trying the Arduino Xbee lib.

I unpacked the zip file into the ARDUINO_HOME/hardware/libraries.

When starting a new sketch, I got :

Error building library "Xbee"

XBee.cpp: In constructor 'XBee::XBee(HardwareSerial&)':
XBee.cpp:337: error: no matching function for call to
'HardwareSerial::HardwareSerial()'
C:\Program Files\Arduino\hardware\cores\arduino/HardwareSerial.h:47:
note: candidates are: HardwareSerial::HardwareSerial(ring_buffer*,
volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile
uint8_t*, volatile uint8_t*, uint8_t, uint8_t, uint8_t, uint8_t)
C:\Program Files\Arduino\hardware\cores\arduino/HardwareSerial.h:30:
note: HardwareSerial::HardwareSerial(const
HardwareSerial&)

Any clue ?

Tx,
Mersing.

Andrew Rapp

unread,
Mar 30, 2009, 10:28:14 AM3/30/09
to xbee...@googlegroups.com
Hi Mersing,

What version of Arduino are you using?  I wasn't able to get that error but I think it can it can be fixed by opening XBee.h and removing the code below, then delete XBee.o and try again.  Please let me know if this works.

Andrew  

#ifdef ECLIPSE

class HardwareSerial {

public:

HardwareSerial();

HardwareSerial(uint8_t* fakePacket, uint8_t size);

bool available();

uint8_t read();

void flush();

void begin(int baud);

void print(uint8_t b, bool t);

uint8_t* _pseudopacket;

uint8_t _size;

// keeps track of fake serial read position

uint8_t _pos;

bool _available;

};

#endif


Mersing

unread,
Mar 30, 2009, 3:28:04 PM3/30/09
to xbee-api
Hi Andrew,

I'm running Arduino Alpha 0015.
I don't have any xbee.o.
I remove the above lines from xbee.h. Same error :

XBee.cpp: In constructor 'XBee::XBee(HardwareSerial&)':
XBee.cpp:337: error: no matching function for call to
'HardwareSerial::HardwareSerial()'
C:\Program Files\Arduino\hardware\cores\arduino/HardwareSerial.h:47:
note: candidates are: HardwareSerial::HardwareSerial(ring_buffer*,
volatile uint8_t*, volatile uint8_t*, volatile uint8_t*, volatile
uint8_t*, volatile uint8_t*, uint8_t, uint8_t, uint8_t, uint8_t)
C:\Program Files\Arduino\hardware\cores\arduino/HardwareSerial.h:30:
note: HardwareSerial::HardwareSerial(const
HardwareSerial&)


However, I removed 0015, and installed 0013. I loaded TxExample. No
more errors, compilation is OK ! (I now I need to running it, eg
wiring arduino and Xbees)


Andrew Rapp

unread,
Mar 30, 2009, 11:06:38 PM3/30/09
to xbee...@googlegroups.com
Mersing,

As you might have guessed, this error was a result of some changes in the Arduino 0015 release.  I just updated the code and provided a new download that fixes the problem.  Now when you create a XBee object, you don't provide Serial anymore, so it looks like XBee xbee = XBee();.  Everything else is the same.

Andrew
Reply all
Reply to author
Forward
0 new messages