Shop OBEX P1 Docs P2 Docs Learn Events
Serially connecting 2 Basic Stamps — Parallax Forums

Serially connecting 2 Basic Stamps

brentbrent Posts: 2
edited 2004-12-07 23:01 in Learn with BlocklyProp
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!

Comments

  • edited 2004-12-07 05:24
    The easiest way to do it is to use the same arguments you are using in your DEBUG command. For example, if it's DEBUG DEC2 left, ".", DEC1 right, that can be converted to SEROUT pin, baudmode, [noparse][[/noparse]DEC2 left, ".", DEC1 right]. Likewise, you can have a command in the receiving BASIC Stamp, something like: SERIN pin, baudmode, [noparse][[/noparse]DEC2 left, char, DEC1 right]. The decimal point doesn't really have to be sent. If it's not sent, the char byte variable that receives the decimal point isn't necessary either.

    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
  • brentbrent Posts: 2
    edited 2004-12-07 20:38
    Thank you for the help Mr. Lindsay. I now have 2 Stamps connected. One measures humidity, sends it over, and the other stamp displays it on one 7-seg LED. yeah.gif
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-12-07 23:01
    I did that in my December 2003 column in Nuts & Volts: used a BS1 as a serial slave display·for a BS2.· The links below may be helpful as you develop more sophisticated Stamp-to-Stamp applications:

    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
Sign In or Register to comment.