Example Code to send/receive data between Basic STAMP and SX
![John Kauffman](https://forums.parallax.com/uploads/userpics/555/nZBNEPT0B6FMD.jpg)
I would like to do sensing & processing in SX/B and then have the data available for a project on a Basic STAMP.
I've had no luck searching the Parallax site, but surely someone has BS2 & SX/B code for this kinf of project.
The STAMP will send a request to the SX for a value (a dozen byte-size values are available in the SX variables)
The SX will send the byte value·back & the STAMP will store it in a variable.
The connecting cable is only 20 cm, so no distance worries.
Can anyone point me to an example? Thanks.
·
I've had no luck searching the Parallax site, but surely someone has BS2 & SX/B code for this kinf of project.
The STAMP will send a request to the SX for a value (a dozen byte-size values are available in the SX variables)
The SX will send the byte value·back & the STAMP will store it in a variable.
The connecting cable is only 20 cm, so no distance worries.
Can anyone point me to an example? Thanks.
·
Comments
I've attached a copy of our (EFX-TEK) firmware for the RC-4 relay board. It uses the Parallax AppMod protocol and communicates over single-wire serial. If you look at the code you can see that it can send and receive requests.
If you SX must be doing something else while serial is coming in or going out then you'll have to use an interrupt and buffer the serial data. If you need, I can show you how we do that, too.
I am going to do a proof-of-concept with two STAMPs so I can use the screen debug tool.
Then I'll switch back to SX.
Goal is to get the simplest possible set of code so I (and others) can pick it up & customize.