Wireless controls
limlik
Posts: 23
What would be the most efficient way to transmit data through serial out put. I am sending data through the serial out and serial in command. I need to send 3 numbers. The issue is that the receiving end needs to be able to know which number is which and not accept any interference, maybe through a handshake type thing with each of the 3 outputs. All of this needs to flow through one connection. Any ideas?
Comments
A5,B234,C0,
Other characters would be ignored at the receiving end, so you could add returns or other identification information.
For error checking, the receiving end could echo back the received value after the comma was received (with the unique prefix). The transmitting end would retransmit a value incorrectly received until it was received correctly.
Post Edited (limlik) : 10/31/2009 10:43:21 PM GMT
Post Edited (limlik) : 11/1/2009 7:34:21 PM GMT
SEROUT <pin>,<Baud>,[noparse][[/noparse]STR arrayName\3]
If they're all 16-bit words, you would need to send them one byte at a time like:
SEROUT <pin>,<Baud>,[noparse][[/noparse]STR arrayName.lowByte\6]
The corresponding SERIN would look much the same.
Post Edited (limlik) : 11/1/2009 10:06:06 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
If you write your code so the sender sends a packet of information (one set of values) every 10-15ms and the data gets sent at 9600 Baud (about one byte every ms), then the receiver should be able to put out a servo control pulse and be ready for the next set of information once every 20ms or so.
Post Edited (limlik) : 11/1/2009 10:32:15 PM GMT