Serially connecting 2 Basic Stamps
brent
Posts: 2
Hello-
I am working on a Mechatronic Project (in my Mech. Egr. course)·that measures humidity inside a cooler. I would like one Stamp to take the measurement (I'm using the SHT11), and another to accept the humidity measurement, and display it using·two 7-segment LEDs.
I have a measurement on the debug screen with XX.X %. I would like the first two X's (before the decimal) to be sent over, but I'm not entirely sure how to do this. Here's what I do know. Both Stamps must use the same baud rate. One stamp must be the receiver and one the transmitter. The receiver will just wait with a SerIn command and a SerOut command on the transmitter will send the measurement. Does it send the measurement as a series of 0's and 1's and if so, can I get my XX out on the other end for use in a lookup command? Any tips?
THANKS!
I am working on a Mechatronic Project (in my Mech. Egr. course)·that measures humidity inside a cooler. I would like one Stamp to take the measurement (I'm using the SHT11), and another to accept the humidity measurement, and display it using·two 7-segment LEDs.
I have a measurement on the debug screen with XX.X %. I would like the first two X's (before the decimal) to be sent over, but I'm not entirely sure how to do this. Here's what I do know. Both Stamps must use the same baud rate. One stamp must be the receiver and one the transmitter. The receiver will just wait with a SerIn command and a SerOut command on the transmitter will send the measurement. Does it send the measurement as a series of 0's and 1's and if so, can I get my XX out on the other end for use in a lookup command? Any tips?
THANKS!
Comments
If you use this method, the DEC formatter converts the binary values to the characters that represent the decimal values before they are transmitted. The DEC in the receiving command does the reverse translation. If you leave out the DEC in both the SEROUT and SERIN command, you will transmit and receive the raw binary value. The end result should be the same.
There are more examples in the BASIC Stamp Manual, and also in the PBASIC Syntax Guide (click Help and select Index in the BASIC Stamp Editor, then look up SERIN and SEROUT).
Post Edited (Andy Lindsay) : 12/7/2004 5:47:02 AM GMT
http://www.parallax.com/dl/docs/cols/nv/vol4/col/nv104.pdf
http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv81.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office