122-28029 Parallax Inc, 122-28029 Datasheet - Page 60
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: 60 of 340
- Download datasheet (5Mb)
Page 48 · Smart Sensors and Applications
Example Program: PingMeasureCm.bs2
' Smart Sensors and Applications - PingMeasureCm.bs2
' Measure distance with Ping))) sensor and display in centimeters.
' {$STAMP BS2}
' {$PBASIC 2.5}
' Conversion constants for room temperature measurements.
CmConstant
cmDistance
time
DO
LOOP
Your Turn - Verifying the Calculations
Let's verify that that the program is correctly calculating the distance.
PULSOUT 15, 5
PULSIN 15, 1, time
cmDistance = CmConstant ** time
DEBUG HOME, DEC3 cmDistance, " cm"
PAUSE 100
√
√
√
√
√
√
S
object-
Enter, save and run PingMeasureCm.bs2.
Move the target object until the measurement displays 20 cm.
Align your ruler with that measurement.
somewhere with the Ping))) sensor, typically somewhere between the printed
circuit board and the front-most part of the speaker/microphone.
Now, experiment with other distance measurements.
Modify PingMeasureCm.bs2 so that it displays the values of both the time and
the distance variables.
Use a calculator to verify that you get the same result from the distance equation
that you do from the program.
cm
CON
VAR
VAR
=
0.03448
2260
Word
Word
×
t
PULSIN
-
BS2
The 0 cm mark should align
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: