28029 Parallax Inc, 28029 Datasheet - Page 100

KIT PARTS SMART SENSORS W/TEXT

28029

Manufacturer Part Number
28029
Description
KIT PARTS SMART SENSORS W/TEXT
Manufacturer
Parallax Inc
Datasheet

Specifications of 28029

Accessory Type
Parts Kit
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
BASIC Stamp® or Javelin Modules
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Other names
28029PAR
Page 88 · Smart Sensors and Applications
This demonstrates that if the angle variable stores a measure of brads, and you want to
store a measure of degrees instead, use this command:
Example Program: TestAtn.bs2
This example program calculates angles based on the y and x values you enter into the
Debug Terminal's Transmit windowpane.
angle = 361 */ angle
Most documents recommend angle = 360 */ angle. However, using a */ scale constant of
361 is slightly more accurate over the input/output ranges. Try comparing the results of this
operation made with a BASIC Stamp to those made with a spreadsheet.
Round the result of angle
component of 0.5 or higher, round up. Otherwise, round down. Then compare it to the 256
possible Debug Terminal outputs with 360 */ angle, then repeat with 361 */ angle.
spreadsheet is useful for this comparison. If you try it, you'll se that the rate of integer value
matches is much higher with 361 */ angle.
angle
degrees
= (360/256) × angle
degrees
brads
to the nearest integer.
Figure 3-18
Tangent and Arctangent
If the result has a fractional
A

Related parts for 28029