I've used it to communicate with several Arduinos at once, and also with an AX-12 motor. It's been tested a little bit and seems to work pretty well up to 57600. Also it's my first time using github so let me know if something's amiss. This is my first attempt at it, so any feedback or help is appreciated. I'm sure it could be written more efficiently, but I wanted it to be as close to the original as possible to reduce maintenance (and hopefully to be considered for merging. Only a few modifications of the SoftwareSerial library were necessary. As such, you can make the TX and RX line the same, because transmission will be disallowed while receiving and vice-versa. Only when a write/print command is called, does the TX line flip to an Output until the byte is sent, and then resets to an Input. With the SoftwareSerialWithHalfDuplex library (sorry for the long name!), by default the TX line works exactly the same as the original, but by adding a couple of optional arguments at instantiation, the TX line can instead be set as an Input, pulled-high. With the standard SoftwareSerial library the TX line is always set as an Output, as you'd expect. The robotis AX-12 motors make use of Half-Duplex Serial for example, and it is often used with RS485. It doesn't however do any error checking or flow control like i2c, so you have to handle that yourself. The value of Half Duplex is that you can daisy-chain a bunch of devices to the same serial line, and communicate with them all.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |