28129 Parallax Inc, 28129 Datasheet - Page 67
28129
Manufacturer Part Number
28129
Description
TEXT BASIC ANALOG & DIGITAL
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet
1.28129.pdf
(176 pages)
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
- Current page: 67 of 176
- Download datasheet (3Mb)
In long division, calculating the part of the answer to the right of the decimal point is
repetitive. We multiply the remainder by 10, then divide by 255 again, then take another
remainder, multiply it by 10, and divide by 255 again, etc. A shortcut to this procedure is
to take the remainder, and multiply it by 100, then divide by 255. This gives us two
decimal places. Let's try it.
Remember: the BASIC Stamp cuts off everything to the right of the decimal point
without rounding. This is called truncating. The result we get is 23. This result should
have been rounded up to 24 because 23.5294 is more than half way to the next integer
value, 24. For now, let's stick with 23 to the right of the decimal point.
Our answer using this algorithm is the integer 3 to the left of the decimal point, and the
integer value 23 to the right of the decimal point. Since we used only integers in our
arithmetic, it should work using PBASIC and the BASIC Stamp.
Since the BASIC Stamp works with integers, it's not surprising that there is a PBASIC
command to calculate the integer remainder of a division problem. The operator for
division is / and the operator for getting the remainder is //. Let's try converting this
algorithm into PBASIC code to do the work for us. The steps for long division below
show the PBASIC commands corresponding to the steps in the algorithm.
v=5*adcBits/255
v2=(100*R)/255
Voltage
(60
What’s an Algorithm? An algorithm is a procedure for solving a problem. The procedure is
broken down into repeatable steps.
×
100)
=
÷
5
255
×
(Decimal
=
6000
255 5 adcBits
255 100 r
255
÷
A/D
×
255
×
v2
Output)
=
23.5924...
v r
+
=
3
+
a
Integer
remainder
Math
R=(5*adcBits//255)
→
23
of
60
Related parts for 28129
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: