Received: by 10.224.180.205 with SMTP id bv13mr5491712qab.8.1345991813162; Sun, 26 Aug 2012 07:36:53 -0700 (PDT) X-BeenThere: xbee-api@googlegroups.com Received: by 10.224.214.132 with SMTP id ha4ls4592981qab.1.gmail; Sun, 26 Aug 2012 07:36:52 -0700 (PDT) Received: by 10.224.209.202 with SMTP id gh10mr5505565qab.2.1345991812816; Sun, 26 Aug 2012 07:36:52 -0700 (PDT) Received: by 10.224.180.16 with SMTP id bs16msqab; Sat, 25 Aug 2012 23:37:53 -0700 (PDT) Received: by 10.236.109.233 with SMTP id s69mr645894yhg.11.1345963073449; Sat, 25 Aug 2012 23:37:53 -0700 (PDT) Date: Sat, 25 Aug 2012 23:37:52 -0700 (PDT) From: Charles Walker To: xbee-api@googlegroups.com Message-Id: Subject: Patch for New Arduino Leonardo Board support MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2166_10730623.1345963072419" ------=_Part_2166_10730623.1345963072419 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hello, I ve bought a new Arduino board "Arduino Leonardo" : http://arduino.cc/en/Main/arduinoBoardLeonardo This card is the same as Arduino UNO with a Real USB stack (I think it will become popular in a near future). Due to its USB support the serial has been change (default serial is USB) and to be able to use it with the Xbee library I had to change some things in the Xbee library. Here is the patch : Index: XBee.cpp =================================================================== --- XBee.cpp (revision 42) +++ XBee.cpp (working copy) @@ -766,7 +766,12 @@ _response.init(); _response.setFrameData(_responseFrameData); // default - _serial = &Serial; +#if defined(USBCON) + _serial = &Serial1; +#else + _serial = &Serial; +#endif + } uint8_t XBee::getNextFrameId() { It is still compatbile with Arduino Uno. It break nothing...only add the support of Arduino Leonardo. This patch was originaly propose on Arduino support forum here : http://arduino.cc/forum/index.php/topic,111354.0.html Can you please integrate it on the repository ? Thx ------=_Part_2166_10730623.1345963072419--