Parallax BASIC Stamp 2e Programming Manual page 294

Table of Contents

Advertisement

SERIN - BASIC Stamp Command Reference
Demo Program
(SERIN-OUT_SENDER.bs2 & SERIN-OUT_RECEIVER.bs2)
' Using two BS2-IC's, connect the circuit shown in the SERIN 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 SERIN 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
BYTE
Again:
SERIN 1\0, 16468, [Letter]
DEBUG Letter
PAUSE 1000
GOTO Again
Case2:
DEBUG "Branched to Case2",cr
GOTO Start
Page 292 • BASIC Stamp Programming Manual 2.0b • www.parallaxinc.com
'STAMP directive (specifies a BS2)
' Send the greeting.
' Get 1 byte.
' Display on screen.
' Wait a second.
2
2
2
2
e
p
sx
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.

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