Parallax BASIC Stamp 2e Programming Manual page 309

Table of Contents

Advertisement

2
2
e
NOTE: This is written for the BS2
but can be used for the BS2e,
BS2sx and BS2p also (with
modifications). Locate the proper
source code file or modify the
STAMP directive and the
Baudmode before downloading to
the BS2e, BS2sx or BS2p.
5: BASIC Stamp Command Reference – SEROUT
2
2
Demo Program
sx
p
' Using two BS2-IC's, connect the circuit shown in the SEROUT command description and
' run this program on the BASIC Stamp designated as the Sender. This program
' demonstrates the use of Flow Control (FPin). Without flow control, the sender would
' transmit the whole word "HELLO!" in about 6 ms. The receiver would catch the first byte at
' most; by the time it got back from the first 1-second PAUSE, the rest of the data would be
' long gone. With flow control, communication is flawless since the sender waits for the
' receiver to catch up.
'{$STAMP BS2}
Loop:
SEROUT 1\0, 16468, ["HELLO!"]
PAUSE 2500
GOTO Loop
' Using two BS2-IC's, connect the circuit shown in the SEROUT command description and
' run this program on the BASIC Stamp designated as the Receiver. This program
' demonstrates the use of Flow Control (FPin). Without flow control, the sender would
' transmit the whole word "HELLO!" in about 6 ms. The receiver would catch the first byte at
' most; by the time it got back from the first 1-second PAUSE, the rest of the data would be
' long gone. With flow control, communication is flawless since the sender waits for the
' receiver to catch up.
Letter
VAR
Again:
SERIN 1\0, 16468, [Letter]
DEBUG Letter
PAUSE 1000
GOTO Again
Case2:
DEBUG "Branched to Case2",cr
GOTO Start
(SERIN-OUT_SENDER.bs2 & SERIN-OUT_RECEIVER.bs2)
BYTE
BASIC Stamp Programming Manual 2.0c • www.parallaxinc.com • Page 307
'STAMP directive (specifies a BS2)
' Send the greeting.
' Get 1 byte.
' Display on screen.
' Wait a second.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?

Table of Contents