28128 Parallax Inc, 28128 Datasheet - Page 69

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
All that remains to be done is to correct the rounding error in the hundredth’s place. This
rounding problem can be corrected by adding the segment of code shown below to the
Calc_Volts
Calc_Volts:
RETURN
v = 5 * adcBits / 255
r = 5 * adcBits // 255
v2 = 100 * r / 255
v3 = 100 * r // 255
v3 = 10 * v3 / 255
IF (v3 >= 5) THEN v2 = v2 + 1
IF (v2 >= 100) THEN
ENDIF
subroutine.
v = v + 1
v2 = 0
'
'
'
'
'
'
'
new line
new line
new line
new line
new line
new line
new line
Figure 3-8
Debug
Terminal
Output for
Program
Listing 3.1,
Revision 3.

Related parts for 28128