122-28029 Parallax Inc, 122-28029 Datasheet - Page 120
122-28029
Manufacturer Part Number
122-28029
Description
GUIDE STUDENT SMART SENSORS
Manufacturer
Parallax Inc
Datasheet
1.122-28029.pdf
(340 pages)
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
- Current page: 120 of 340
- Download datasheet (5Mb)
Page 108 · Smart Sensors and Applications
Example Program: HorizontalTilt.bs2
This example program displays your board's tilt in terms of degrees from horizontal.
' -----[ Title ]--------------------------------------------------------------
' Smart Sensors and Applications - HorizontalTilt.bs2
' Test arcsine for sine values from -127 to 127.
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ Constants ]----------------------------------------------------------
Negative
Positive
' -----[ Variables ]----------------------------------------------------------
x
y
side
angle
sign
' -----[ Initialization ]-----------------------------------------------------
DEBUG CLS
' -----[ Main Routine ]-------------------------------------------------------
DO
PULSIN 6, 1, x
√
√
LOOP
Enter, save and run HorizontalTilt.bs2.
Compare various tilt angles to the Debug Terminal's axis display.
side = x
GOSUB Arcsine
DEBUG HOME, "x tilt angle = ", CLREOL, SDEC3 angle, CR
side = y
GOSUB Arcsine
DEBUG "y tilt angle = ", CLREOL, SDEC3 angle
PAUSE 100
CON
CON
VAR
VAR
VAR
VAR
VAR
1
0
Word
Word
Word
Word
Bit
' BASIC Stamp Directive
' PBASIC Directive
' Sign - .bit15 of Word variables
' Memsic x-axis measurement
' Memsic y-axis measurement
' trig subroutine variable
' result angle - degrees
' Sign bit
' Clear Debug Terminal
' x-axis measurement
Related parts for 122-28029
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
Part Number:
Description:
MANUAL FOR SUMOBOT
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
GUIDE STUDENT PROCESS CONTROL
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
MANUAL PROPELLER
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
LEAD WIRES FLYING CABLE III/IV
Manufacturer:
Xilinx Inc
Datasheet:
Part Number:
Description:
BOARD ADAPTER AND FLY LEADS
Manufacturer:
Xilinx Inc
Datasheet:
Part Number:
Description:
PLATFORM CABLE USB II
Manufacturer:
Xilinx Inc
Datasheet:
Part Number:
Description:
KIT STARTER COOLRUNNER-II BUNDLE
Manufacturer:
Xilinx Inc
Datasheet:
Part Number:
Description:
Microcontroller Modules & Accessories DISCONTINUED BY PARALLAX
Manufacturer:
Parallax Inc
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:
BOARD EXPERIMENT+LCD NX-1000
Manufacturer:
Parallax Inc
Datasheet:
Part Number:
Description:
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer:
Parallax Inc
Datasheet: