28128 Parallax Inc, 28128 Datasheet - Page 66
28128
Manufacturer Part Number
28128
Description
KIT BASIC ANALOG/DIGI PARTS ONLY
Manufacturer
Parallax Inc
Datasheet
1.28129.pdf
(176 pages)
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
- Current page: 66 of 176
- Download datasheet (3Mb)
The PBASIC command set for the BASIC Stamp does arithmetic using integer values.
Integers are the counting numbers: …-2, -1, 0, 1, 2, 3, etc. The largest integer the BASIC
Stamp can process is 65535. When using integer arithmetic, the fractional part of any
answer is discarded. Fortunately, we can still use integer arithmetic to find the fractional
values we are trying to display.
Before dividing, the A/D output is multiplied by 5. This doesn’t cause any problems.
In our voltage calculation example, that’s
less than 65535, this part of the calculation goes without a hitch. The problem occurs
when we try to divide 825 by 255. The answer has a fractional component that never gets
calculated with integer math.
Doing “long division” with a pencil and a piece of paper takes several steps, and it relies
solely on integer arithmetic. Let's look at how to calculate the answer for this division
problem.
5
×
(Decimal
A/D
Output)
is essentially the same as
5
×
165
=
5
825.
×
adcBits
Since 825 is an integer that is
.
Figure 3-7
Debug Terminal
Output for Program
Listing 3.1, Revision
2.
Related parts for 28128
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
Part Number:
Description:
BOOK UNDERSTANDING SIGNALS
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
COMPETITION RING FOR SUMOBOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
TEXT INFRARED REMOTE FOR BOE-BOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
CONTROLLER 16SERVO MOTOR CONTROL
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
BASIC STAMP LOGIC ANALYZER
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: