EasyManuals Logo

Parallax PING))) 28015 User Manual

Default Icon
10 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #7 background imageLoading...
Page #7 background image
Copyright © Parallax Inc. PING))) Ultrasonic Distance Sensor (#28015) v2.0 2/4/2013 Page 7 of 9
Example Program: PingMeasureCmAndIn.bs2
This program for the BASIC Stamp 2 displays distance measurements in both inches and centimeters in
the BASIC Stamp Debug Terminal. The example program can be downloaded from the 28015 product
page at www.parallax.com. The BASIC Stamp Editor software, which includes the Debug Terminal, is a
free download from www.parallax.com/basicstampsoftware.
' Smart Sensors and Applications - PingMeasureCmAndIn.bs2
' Measure distance with Ping))) sensor and display in both in & cm
' {$STAMP BS2}
' {$PBASIC 2.5}
' Conversion constants for room temperature measurements.
CmConstant CON 2260
InConstant CON 890
cmDistance VAR Word
inDistance VAR Word
time VAR Word
DO
PULSOUT 15, 5
PULSIN 15, 1, time
cmDistance = cmConstant ** time
inDistance = inConstant ** time
DEBUG HOME, DEC3 cmDistance, " cm"
DEBUG CR, DEC3 inDistance, " in"
PAUSE 100
LOOP

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Parallax PING))) 28015 and is the answer not in the manual?

Parallax PING))) 28015 Specifications

General IconGeneral
BrandParallax
ModelPING))) 28015
CategoryAccessories
LanguageEnglish

Related product manuals