28128 Parallax Inc, 28128 Datasheet - Page 81

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
Editor and make sure to save it for future use. When the circuit is built and the code is
entered and saved, run Program Listing 4.1, and let's see how it works.
' -----[ Title ]-----------------------------------------------------------
' Basic Analog and Digital - PL4_1R0.bs2
' Digital Voltmeter (DVM). D/A Converter Added
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ Declarations ]----------------------------------------------------
adcBits
v
r
v2
v3
n
' -----[ Initialization ]--------------------------------------------------
CS
CLK
DataOutput
DEBUG CLS
' -----[ Main Routine ]----------------------------------------------------
DO
LOOP
' -----[ Subroutines ]-----------------------------------------------------
DAC:
RETURN
ADC_Data:
GOSUB DAC
GOSUB ADC_Data
GOSUB Calc_Volts
GOSUB Display
n = 11
OUTPUT 7
OUTPUT 6
OUTPUT 5
OUTPUT 4
OUT7 = n.BIT3
OUT6 = n.BIT2
OUT5 = n.BIT1
OUT4 = n.BIT0
HIGH CS
LOW CS
VAR
VAR
VAR
VAR
VAR
VAR
PIN
PIN
PIN
Byte
Byte
Byte
Byte
Byte
Nib
0
1
2
'Start display.

Related parts for 28128