Communicating prop to prop with FullDuplexSerialPlus
Ragtop
Posts: 406
I am having trouble making a serial connection between two props. I am only using one wire connected
to TX pin of primary prop and to the RX pin of secondary prop (both pin 27) with both running FullDuplexSerialPlus
as ToSecondary and FromPrimary.
On Primary
ToSecondary.start(-1,27,0,57600)
On Secondary
FromPrimary.start(27,-1,0,57600)
When button is pressed on Primary it sends
ToSecondary.dec(1)
In a repeat loop on Secondary:
The program locks up on FromPrimary.getdec(command)
If I comment that out it will show Received string when I press button
on Primary prop so the rxcheck seems to be working........
At wits end. I have command as a long.
to TX pin of primary prop and to the RX pin of secondary prop (both pin 27) with both running FullDuplexSerialPlus
as ToSecondary and FromPrimary.
On Primary
ToSecondary.start(-1,27,0,57600)
On Secondary
FromPrimary.start(27,-1,0,57600)
When button is pressed on Primary it sends
ToSecondary.dec(1)
In a repeat loop on Secondary:
repeat if FromPrimary.rxcheck <> -1 FromPrimary.getdec(command) debug.str(string("............Received: ")) 'debug.str(command) debug.str(string(13)) 'else debug.str(string("waiting"))
The program locks up on FromPrimary.getdec(command)
If I comment that out it will show Received string when I press button
on Primary prop so the rxcheck seems to be working........
At wits end. I have command as a long.
Comments
One of the problems is the the primary is no longer sending any characters, so the secondary is stuck waiting for a string of characters terminated by a carriage return.
Thank you, I think you have me on the right track now....as much as I have used serial objects
I know little on how they actually work.
So the primary needs to send some throw away bit to trigger the if statement, then the value I want and then a carriage return.