FullDuplexSerial.spin
JTC
Posts: 60
· How do you make more than one instantance of the FullDuplexSerial.spin object.
I tried an array and used different RX and TX pins but it would only see on of them.
I don't have my code with me as I am out of town but thought I would ask.
Thanks
Jim
I tried an array and used different RX and TX pins but it would only see on of them.
I don't have my code with me as I am out of town but thought I would ask.
Thanks
Jim
Comments
OBJ serial[noparse][[/noparse] 2 ] : "FullDuplexSerial"
You have to initialize each one like:
serial[noparse][[/noparse] 0 ].start(31,30,%0000,9600)
serial[noparse][[/noparse] 1 ].start(27,26,%0000,9600)
The Baud and mode bits can be different if you want. To transmit out each do:
serial[noparse][[/noparse] 0 ].str(string("Test string",13,10))
serial[noparse][[/noparse] 1 ].str(string("Duplicate string",13,10))
You could also use two different names rather than an array like:
OBJ
console : "FullDuplexSerial"
device : "FullDuplexSerial"
I Will give that a shot. I thought I had tried it this way but ..... Guess not.
Thanks
Jim