122-28029 Parallax Inc, 122-28029 Datasheet - Page 100

GUIDE STUDENT SMART SENSORS

122-28029

Manufacturer Part Number
122-28029
Description
GUIDE STUDENT SMART SENSORS
Manufacturer
Parallax Inc
Datasheet

Specifications of 122-28029

Accessory Type
Manual
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
Smart Sensors
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
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 122-28029