Shop OBEX P1 Docs P2 Docs Learn Events
XBee send and receive from Propeller to Computer in API mode — Parallax Forums

XBee send and receive from Propeller to Computer in API mode

Hi, I would like to know if it is possible to send data from the Propeller to the computer. I saw this thread (http://forums.parallax.com/discussion/127136/xbee-api-tutorial) in the forums, seems to be what I'm looking for, however it is written in Spin and I don't know anything in that language. Does anyone has a version of that code written in C ? Or something equivalent ? I'm a little lost.

Comments

  • It is certainly possible. The only question is, are you willing to write the driver?

    For the computer side, I've used libxbee, which can be used from C or C++. It works great, and has callbacks and everything. Digi has a link to another library, https://github.com/digidotcom/xbee_ansic_library. I've never used it, but from what I can tell it doesn't have callbacks.

    I don't use C on the Propeller, since I think Spin is much better, but there's a complete XBee API interface for the Propeller written in Spin at http://obex.parallax.com/object/763. That link is my version, which uses a different serial driver than the original version.

    You could always port the Spin version to C. If you do this, use the original version, not mine, since the original uses FullDuplexSerial.spin, which has already been ported to C (as libfdserial). Spin is generally very readable, once you know all the funny operators it has, such as "~>" (signed >>) and "variable~", which returns the value of the variable but also sets the variable to zero. All of these operators are explained in detail in the Propeller Manual and all briefly described in the Propeller Quick Reference.

    You might also try getting Digi's C library to work on the Propeller. I think you'd only need to make a src/propeller folder and write three files in it that do platform-specific stuff like serial and timing stuff, and then fix the Makefile (in the samples directory) to know about the Propeller version.
Sign In or Register to comment.