Shop OBEX P1 Docs P2 Docs Learn Events
XBee, SimpleIE and PropC — Parallax Forums

XBee, SimpleIE and PropC

jblivelyjblively Posts: 6
edited 2013-08-16 10:40 in Accessories
Hello,

I've been able to use the XBee successfully with SPIN to communicate from the computer to the PropC Activity Board. However, I can't seem to find an example of it working in the C language to use within SimpleIDE. Does anyone have any tips for XBee (Series 1) communication using SimpleIDE and the C language.

Thanks,

J

Comments

  • jblivelyjblively Posts: 6
    edited 2013-08-13 20:39
    Bump. Does anyone have any ideas or couple point me to an example where XBee is used with C and SimpleIDE for the Propeller chip on the Propeller Activity Board.

    Thanks,

    J
  • dgatelydgately Posts: 1,628
    edited 2013-08-14 07:52
    J,

    Look in this thread for some ideas... http://forums.parallax.com/showthread.php/145335-Issue-with-XBee-AT-command-mode-with-PropGCC-FDS

    Not sure if you intend to use AT commands, but this should provide an example of how to communicate to the XBee in C.


    dgately
  • Charlie JohnsonCharlie Johnson Posts: 147
    edited 2013-08-16 05:44
    Here is some simple working code. I am using the simpleIDE Terminal to display the remote XBee sent text.
    #include "simpletools.h" // Include simpletools
    
    int main() // main function
    {
      int rx_pin = 0;   // XBee DO
      int tx_pin = 1;   // XBee DI
      int mode = 0;     // Unused
      int baud = 9600;  // Default Xbee baud rate
      serial *xb;       // Pointer to text_t structure
    
      xb = serial_open(rx_pin, tx_pin, mode, baud);   // Open up a serial driver
    
      pause(1000);    
      writeLine(xb, "Is this thing on?");   // Look at simpletext.h for all the functions supported.
      serial_close(xb);   // Close the serial driver
    }
    
  • jblivelyjblively Posts: 6
    edited 2013-08-16 10:40
    Thank you both. I'll be able to test it out this weekend and i'll post back with my results.
Sign In or Register to comment.