A couple of XBee Pro Questions
ryfitzger227
Posts: 99
Hello Everyone!
I'm new to the XBee world and just have a couple of questions that relate to my project.
My first question is: How do I receive and transmit strings over XBees with a Propeller and the second is: How would I use XBees as a "Wireless Serial Port."
Alright, first question. What I'm doing is using a VB.NET application to send a string of "A" to the serial port by comPort.write("A,") - the comma is the delimiter for the Extended Full Duplex Serial object. The XBee is in a USB Adapter Board and the other XBee is just in a regular adapter board. I have the DOUT on XBee #2 connected to Pin 1 on the Propeller and DIN is connected to Pin 2. I have used the loopback code provided by Parallax and the Parallax Serial Terminal to successfully send and receive the same character back. But when I tried to do something with strings and VB.NET I was not successful. Here's the code I wrote:
As you can see, all I'm trying to do here is wait for the variable readBuffer to equal "A" and then light the P16 LED on the QuickStart board. What am I doing wrong here?
The next question doesn't involve a Parallax product at all. Just 2 XBees and an Epson Thermal Printer. What I would like to do is use the XBees like a "wireless USB cable." My idea was connect the Thermal Printer green USB wire to IO0 on the XBee and the white USB wire to IO1 and have them set to inputs. Then on the other XBee have another USB cable going to the computer with the same connections, except having them set as low outputs. Would this actually work? I'd like to know if anyone's tried something like this (or if they know the correct way to do this) before I go chopping up USB cables.
Again, this is my first project with XBees, thanks for all of your help.
- Ryan
I'm new to the XBee world and just have a couple of questions that relate to my project.
My first question is: How do I receive and transmit strings over XBees with a Propeller and the second is: How would I use XBees as a "Wireless Serial Port."
Alright, first question. What I'm doing is using a VB.NET application to send a string of "A" to the serial port by comPort.write("A,") - the comma is the delimiter for the Extended Full Duplex Serial object. The XBee is in a USB Adapter Board and the other XBee is just in a regular adapter board. I have the DOUT on XBee #2 connected to Pin 1 on the Propeller and DIN is connected to Pin 2. I have used the loopback code provided by Parallax and the Parallax Serial Terminal to successfully send and receive the same character back. But when I tried to do something with strings and VB.NET I was not successful. Here's the code I wrote:
OBJ XB : "Extended_FDSerial" CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 VAR byte readBuffer Pub Go XB.start(0, 1, 0, 9600) ' Initialize comms for XBee repeat until readBuffer == "A" XB.RxStr(@readBuffer) dira[16] := 1 outa[16] := 1 repeat
As you can see, all I'm trying to do here is wait for the variable readBuffer to equal "A" and then light the P16 LED on the QuickStart board. What am I doing wrong here?
The next question doesn't involve a Parallax product at all. Just 2 XBees and an Epson Thermal Printer. What I would like to do is use the XBees like a "wireless USB cable." My idea was connect the Thermal Printer green USB wire to IO0 on the XBee and the white USB wire to IO1 and have them set to inputs. Then on the other XBee have another USB cable going to the computer with the same connections, except having them set as low outputs. Would this actually work? I'd like to know if anyone's tried something like this (or if they know the correct way to do this) before I go chopping up USB cables.
Again, this is my first project with XBees, thanks for all of your help.
- Ryan
Comments