@@ -7,7 +7,7 @@ and then calculates the corresponding distance (based on the speed of ultrasound
7
7
in air) and displays the distance (in cm) on the Serial Monitor.
8
8
9
9
Here is how the Vernier Motion Detector works:
10
- - when pin 2 on BTD is pulled high, this triggers the ultrasound pulse
10
+ - when pin 2 on BTD is pulled high the ultrasound pulse is triggered
11
11
- the program then starts timing but then delays 0.9 ms *(blanking time,
12
12
0.9 seconds is the time it takes ultrasound to travel 15 cm twice (round trip))
13
13
- the program then monitors pin 1 on the BTD, waiting for it to go high.
@@ -16,8 +16,8 @@ This happens when an echo is detected.
16
16
As written, the reading will be displayed roughly every quarter of a second.
17
17
Change the delay at the end of the loop to change the rate.
18
18
19
- This version turns on an LED connected to pin 13,
20
- if the distance is less than one meter
19
+ This version turns on an LED connected to pin 13 if the distance is less
20
+ than one meter.
21
21
22
22
See www.vernier.com/arduino for more information.
23
23
*/
@@ -61,7 +61,7 @@ void loop()
61
61
do
62
62
{
63
63
val =digitalRead (EchoPin);
64
- // if no echo, repeat loop and wait:
64
+ // if no echo, repeat loop and wait
65
65
}
66
66
while (val == LOW) ;
67
67
Duration =micros () - time ;
0 commit comments