28029 Parallax Inc, 28029 Datasheet - Page 70

KIT PARTS SMART SENSORS W/TEXT

28029

Manufacturer Part Number
28029
Description
KIT PARTS SMART SENSORS W/TEXT
Manufacturer
Parallax Inc
Datasheet

Specifications of 28029

Accessory Type
Parts Kit
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
BASIC Stamp® or Javelin Modules
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Other names
28029PAR
Page 58 · Smart Sensors and Applications
inDistance
time
PAUSE 200
SEROUT 14, 84, [22, 12]
PAUSE 5
DEBUG CLS, "Program running..."
DO
LOOP
Your Turn - Customizing the Display
ACTIVITY #5: TEMPERATURE'S EFFECT ON THE SPEED OF SOUND
This activity investigates changes in the speed of sound caused by changes in air
temperature. These changes in the speed of sound can result in visible changes to your
distance measurements.
Speed of Sound Vs Temperature and Percent Error Measurements
The speed of sound changes with air temperature, humidity, and even air quality. Neither
humidity nor air quality make enough of a difference to figure into Ping))) sensor
PULSOUT 15, 5
PULSIN 15, 1, time
cmDistance = cmConstant ** time
inDistance = inConstant ** time
SEROUT 14, 84, [128, DEC3 cmDistance, " cm"]
SEROUT 14, 84, [148, DEC3 inDistance, " in"]
PAUSE 100
The measurements are currently left-justified. Try centering them.
Try right justifying the measurements and displaying "Distance: " before the cm
measurement on the LCD's top line.
Modify the program so that it displays both of the distance measurements on the
top line. Then, display the actual echo time on the bottom line. You can display
it in millionths of a second (µs) by multiplying the time variable by 2 before
displaying it. Make sure your program waits until after it has done its distance
conversions before multiplying time by 2.
VAR
VAR
Word
Word

Related parts for 28029