28129 Parallax Inc, 28129 Datasheet - Page 41

TEXT BASIC ANALOG & DIGITAL

28129

Manufacturer Part Number
28129
Description
TEXT BASIC ANALOG & DIGITAL
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet

Specifications of 28129

Style
Book
Title
Basic Analog and Digital
Contents
Basic Analog and Digital Text
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
Reprogramming to Receive Serial Data
Enter Program Listing 2.2 into the BASIC Stamp Editor, and save it under the name
PL2_2R0.bs2.
' Basic Analog and Digital - PL2_2R0.bs2
' Program Listing 2.2 Revision 0.
' {$STAMP BS2}
' {$PBASIC 2.5}
n
d
INPUT 0
INPUT 1
FOR n = 1 TO 4
NEXT
DEBUG CR, CR, "Done shifting.", CR, CR
DEBUG "Decimal value: ", DEC2 d, CR, CR
The Output
The Debug Terminal will initially show a blank screen when you run the program.
Follow these instructions carefully to send the synchronous, serial data. First, press and
hold the right button. Then press and release the left button. The output should look like
Figure 2-5 below.
DO
LOOP UNTIL IN1=1
DO
LOOP UNTIL IN1=0
d = d << 1
d = d + IN0
DEBUG HOME, "Shifting in bits: ", BIN4 d
'Wait for high
'Wait for low
VAR
VAR
Nib
Nib

Related parts for 28129