andrewrapp / xbee-arduino

Arduino library for communicating with XBee radios in API mode
GNU General Public License v2.0
334 stars 162 forks source link

Support for devices without hardware Serial #19

Open iuli4n opened 8 years ago

iuli4n commented 8 years ago

I tried running this on a Trinket (which runs ATtiny chip), and that device doesn't have a hardware Serial, therefore the XBee.cpp file doesn't compile because XBee::XBee(): _response(XBeeResponse()) tries to do: _serial = &Serial;

The way I fixed my compilation problem is by editing the _response function and setting _serial = 0; but that seems like a hack. (PS: I ran into some other problems with my Trinkets, so I don't know if that actually worked).

p3p1 commented 8 years ago

I've the same problem when I try connect an Xbee Series 2 to Arduino Due in API mode. In fact I'm able to receive a package (with "Hello" string) on my computer sended by arduino. But when I try to send a trasmit request 16-bit address (with "Hello" string) from my computer to arduino getResponse(), I think, that is always null

iuli4n commented 8 years ago

@pepib: I don't think that is related to my issue. Does your Arduino code compile on Due ? If yes, then your problem is not related to the issue I reported.

Sleepnow commented 8 years ago

It is a hack, but it's the only reference to Serial in the code. Looks like it should work? Will dig out a trinket and test it later.