28128 Parallax Inc, 28128 Datasheet - Page 41

no-image

28128

Manufacturer Part Number
28128
Description
KIT BASIC ANALOG/DIGI PARTS ONLY
Manufacturer
Parallax Inc
Datasheet

Specifications of 28128

Accessory Type
ADC, DAC
Product
Microcontroller Accessories
For Use With/related Products
BASIC Stamp® 2 and Board of Education
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
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 28128