Need some xbee to PROP Help!
Kevin Pace
Posts: 7
I am a school teacher working in Va Beach and have been working on running robots with the PROP.·
I currently have had success running the Robots with the PS2 Controller thanks to some help from the Parallax crew!·
Anyway, I am attaching some code I have been using for running the Robots through the wireless pS2 link.· What I would prefer to do is run the serial data from a PS2 Wired controller into a PROP/XBee Transmitter board and over to a PROP/Xbee Receiver board.·
I already have a pair of boards constructed and have been able to test my xbee units in the xctu software.· I have been able to use the Parallax Serial Terminal to receive the packet of 11111's on the receiver side, but I can't get any data from the controller when I push the buttons.·
I'm attaching the files I am currently working with.·
I'm moderately familiar with Spin Code and I do have the "Offical Guide to Programming and Customizing the Multicore Propeller Microcontroller.·
I have been combing over the chapter on Wirelessly networking Prop Chips and although I have completed several of the xbee tasks such as the PC to xbee communications·where the xbee's were recognized and restored to default configuration as well as the Sending data from the prop to PC section Im a bit lost on what code I will need in the PS2.xbee Test file I have attached.·
Any help would be appreciated as well as any guide to resources.
Thanks
I currently have had success running the Robots with the PS2 Controller thanks to some help from the Parallax crew!·
Anyway, I am attaching some code I have been using for running the Robots through the wireless pS2 link.· What I would prefer to do is run the serial data from a PS2 Wired controller into a PROP/XBee Transmitter board and over to a PROP/Xbee Receiver board.·
I already have a pair of boards constructed and have been able to test my xbee units in the xctu software.· I have been able to use the Parallax Serial Terminal to receive the packet of 11111's on the receiver side, but I can't get any data from the controller when I push the buttons.·
I'm attaching the files I am currently working with.·
I'm moderately familiar with Spin Code and I do have the "Offical Guide to Programming and Customizing the Multicore Propeller Microcontroller.·
I have been combing over the chapter on Wirelessly networking Prop Chips and although I have completed several of the xbee tasks such as the PC to xbee communications·where the xbee's were recognized and restored to default configuration as well as the Sending data from the prop to PC section Im a bit lost on what code I will need in the PS2.xbee Test file I have attached.·
Any help would be appreciated as well as any guide to resources.
Thanks
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my new website!!
Use the Propeller icon!!
Follow me on Twitter! Search "Microcontrolled"
repeat
buttons := !ps2.Get_Data1
xb.dec(buttons)
xb.CR
waitcnt(t+=dT)
On the receiver:
repeat
buttons := xb.rxDecTime(ms)
then do what you need with buttons checking for -1 as a timeout
John Abshier
Why wouldn't you be able to send PS2 commands as a serial string?
I am trying to send the PS2 (SERIAL DATA) from the transmitter xbee to the reciever xbee.
I have had some issues with trying to determine how to assign the xbee pins to PROP pins.
xbee pin 2 is PROP pin 3 and xbee pin 3 is PROP pin 2.
I have seen the examples of the assignment for the xbee pins but not the xbee connected to the PROP.
Thanks for the help!
repeat 4
XB.tx(buttons & $FF)
buttons >>= 8 ' destroys variable buttons use a copy if you need to perserve it.
For receiver
buttons := 0
repeat 4
buttons >>= 8
buttons |= XB.rx << 24
I would probably send a start of data flag for synchronization, idealy something that could never be a valid value of buttons. THE BIG QUESTION IS, if it is working with decimal, why do you want to change to binary?
John Abshier
We are still doing a lot of active work on the wireless drivers, but if you're willing to hop on board a moving project ... I think we have enough functionality currently in place to do what you need.
We use API mode because the AT serial emulation quickly becomes more of a problem than a help (like transmitting packets of binary data)
The simplest place for you to start is with our global memory mechanism. We setup a shared block of memory that is kept synchronized in all connected propellers (every XBEE with same PAN ID)
Say you have 10 longs of shared memory in an array called world[noparse]/noparse
The transmitter will set world[noparse][[/noparse]0..3] to be output periodically.
then just fill this array on the transmitter with data from joystick (axis + buttons)
on the receivers just read from world[noparse][[/noparse]0..3]
simple and efficient ... perfect for remote control like you are doing.
there's other things our wireless driver can do like send / receive mail messages and create private "terminal" connections (kinda like the serial emulation mode, but between arbitrary xbee nodes)
also we're going to have remote programming and tight integration with 12blocks ... but for now the shared memory works well and I think that is sufficient for what you are trying to do.
You'll need to be able to run the X-CTU utility to reconfigure the xbees for API mode ... and you will need at least to have the XBEE TX, RX and RTS line connected to a propeller pin (connect CTS also but I don't think we're really using that right now)
If this sounds like something you'd like to try out let me know and I'll get you setup.