28129 Parallax Inc, 28129 Datasheet - Page 64

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
Calculate Voltage
Now that we know the decimal equivalent of the ADC0831’s binary output, we can do a
few calculations to get the measured voltage. To find out what voltage the decimal
number corresponds to, we need to calculate where in the voltage range the number falls.
Here is an effective way to think about the problem.
This translates to fractions as:
We can re-arrange this equality to calculate the voltage:
We know that the voltage is on a 0 to 5 volt scale, and we know that the
ADC0831’s output is on a scale from 0 to 255.
In other words, the measured voltage is to 5 as the A/D output is to 255.
Voltage=
Voltage
5
=
5
Decimal
×
(Decimal
A
255
255
/
A/D
D
Output
Output)
Figure 3-6
Debug Terminal
Output for Program
Listing 3.1,
Revision 1.

Related parts for 28129