Great work on the XBEE stuff. IÃ¢â‚¬â„¢m really interested in this since XBEE will open a lot of new possibilities like bidirectional communication. (and maybe speed up the transmission?) And itÃ¢â‚¬â„¢s a bit cheaper to have a XBEE module on every bot. Having a RC receiver on every bot is pretty expÃ¢â‚¬Â¦
Are you planning on replacing the RC module or are you planning on having both of them in the same remote? This would be totally great. DonÃ¢â‚¬â„¢t know if it is possible though. Free pins and space are very limited now.
1) I need to develope some form of handshake between the two units. I could keep blasting out the current info and have the receiver try to figure out where a new frame of information starts (seems primitive). Could Work closer to PS2 code, where Robot sends a request and waits for Controller to send current data. Next option would be for Controller to know if data has changed and send out a simple pulse saying I have something new. The Robot when it receives this and desires the new data can then query it when it is ready. This should cut down traffic a lot. Could enhance this to by setting thresholds on how much the data needs to change before the change signal is generated...
IÃ¢â‚¬â„¢m in for a bit of both options. I think the bot side should have the option to query the status of the remote at all time. It would be great if the remote gives a signal if something is changed. This will limit the data and battery use. Would something like this be possible?
Maybe you could make two different query commands. Like give me all data (when the bot (re)starts) and one like give all changed data. This would also cut down the traffic. Although there is a possibility the bot can miss some dataÃ¢â‚¬Â¦
2) What form of data should be sent. Lots of possibilities, but the main ideas are: Leave it in RC servo format 1500 center (Does not make a lot of sense here). Convert it to be very similar to PS2 packet. 1 byte for each slider/direction of stick with 128 as zero, and 2 bytes for the state of the buttons. This would work well, but I believe we found that these joysticks maybe had a range of 392-692 (~300 values), so converting to 1 byte would lose some accuracy. Could instead send 2 bytes per slider/joystick (SWORD). More accuracy but longer transmit/receive time. Might be a good tradeoff if you need this. Optionally the code could be setup to send either. Buttons would be encoded as 2 bytes, with 1 bit for each button.
I think that sending bytes like you decided to do is better then sending data in servo format. So I totally agree with your decision.
3) Should we reserve one (or more) of the buttons on the keypad for stuff on the remote. For example you may want to press a button and have it display the different robots, you have configured your remote to control and allow you choose which one... Could add another button for this but currently I have only 1 (2 if I don't use RTS) or maybe 3 if I use some hardware hack on P9 which I believe Xan has done.
IÃ¢â‚¬â„¢m using the rotary / push button to control / setup stuff on my radio. IÃ¢â‚¬â„¢m using it to scroll though different kind of information which allows me to view other stuff like the battery voltage.
Although IÃ¢â‚¬â„¢ve started out using P9 IÃ¢â‚¬â„¢m not using that pin at the moment. I totally reswapped the pin layout so I should see what I pins IÃ¢â‚¬â„¢m really using. But having the push button on P9 gave me a buzzing sound. So combined that signal with one of the 4 outputs used for the keyboard. This works great. Let me know if you need more information on this. I should make some documentation and post it on the forum somewhere for others to uses as well.
4) What to display on the LCD. Could keep like now which shows the values, which is great for debugging, but may not be that interesting in other cases. Could hard code several pages that you can cycle through and/or could have pages or fields that the current robot could upload. Things like distance to object, or how many things have I fired, or I just fell down...
This is simple, add the same push / rotary button as I did
I made some progress, I am currently using HSERIAL to do the XBEE on both ends. Ran into minor linker problems with using serin with RTS line.
If I remeber correctly there was a little problem using HSERIAL in Xan's code? Something about conflict in the interrupts? Well I'm not sure though..
Interrupts used by the HSERIAL command will mess up other timed stuff. It messes up Ã¢â‚¬Å“normalÃ¢â‚¬