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

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
' Smart Sensors and Applications - VertWheelRotation.bs2
' Mount accelerometer on a vertical wheel and measure
' the rotation angle.
'{$STAMP BS2}
'{$PBASIC 2.5}
angle
x
y
DO
LOOP
Your Turn - Debug Terminal Behavior
This
angle
before each number is to prevent characters that don't disappear on the right of some
measurements. For example, if one measurement is −105, and the next measurement is
076, it will display as 0755 if the
displaying the new one. Although
PULSIN 6, 1, x
PULSIN 7, 1, y
x = (x MIN 1875 MAX 3125) - 1875 ** 13369 - 127
y = (y MIN 1875 MAX 3125) - 1875 ** 13369 - 127
angle = x ATN y
angle = angle */ 361
DEBUG HOME, CLREOL, SDEC ? x,
PAUSE 100
DEBUG
and the degree symbol (which is the ASCII code 176). The reason
Enter, save, and run VertWheelRotation.bs2.
Hold the board in vertically in front of you like a steering wheel.
Rotate the board clockwise, and watch the angle measurement grow.
Verify that the display angle ranges from 0 to 359.
command below displays signed values of the
CLREOL, SDEC ? y,
"angle = ", CLREOL,
DEC angle,
176
VAR
VAR
VAR
Word
Word
Word
CLS
CLREOL
can fix this problem too, the Debug Terminal
Chapter 3: Tilt with the Memsic Accelerometer · Page 95
doesn't clear the previous value before
' ASCII 176 is degree symbol
x
and
y
variables followed by
CLREOL
comes

Related parts for 122-28029