
107
www.keyestudio.com
generally output.
int echoPin = 4;
this is defined as the pin of reception, generally
input
cm = (duration/2) / 29.1;
inches = (duration/2) / 74;
by
0.0135
We can calculate the distance by using the following formula:
distance = (traveltime/2) x speed of sound
The speed of sound is: 343m/s = 0.0343 cm/uS = 1/29.1 cm/uS
Or in inches: 13503.9in/s = 0.0135in/uS = 1/74in/uS
We need to divide the travel time by 2 because we have to take into
account that the wave was sent, hit the object, and then returned
back to the sensor.
(9) Extension Practice:
We have measured the distance displayed by the ultrasonic. How
about controlling the LED with the measured distance? Let's try it,
connect an LED light module to the D10 pin.
Содержание Ks0428
Страница 21: ...21 www keyestudio com...
Страница 24: ...24 www keyestudio com...
Страница 27: ...27 www keyestudio com...
Страница 29: ...29 www keyestudio com Step 6 Install Sensors and Boards...
Страница 31: ...31 www keyestudio com...
Страница 32: ...32 www keyestudio com Step 7 Hook up Guide...
Страница 33: ...33 www keyestudio com...
Страница 34: ...34 www keyestudio com...
Страница 35: ...35 www keyestudio com Step 8 Wire Up LED Panel...
Страница 37: ...37 www keyestudio com...
Страница 38: ...38 www keyestudio com...
Страница 39: ...39 www keyestudio com...
Страница 40: ...40 www keyestudio com...
Страница 41: ...41 www keyestudio com...
Страница 42: ...42 www keyestudio com...
Страница 54: ...54 www keyestudio com...
Страница 58: ...58 www keyestudio com 5 Arduino IDE Setting Click icon open Arduino IDE...
Страница 63: ...63 www keyestudio com Click to start compiling the program check errors...
Страница 72: ...72 www keyestudio com Connection Diagram Seen from the above diagram LED is linked with D2...
Страница 103: ...103 www keyestudio com 5 Connection Diagram...
Страница 126: ...126 www keyestudio com 8 Click Read Notify WriteWithoutResponse to enter the following page...
Страница 163: ...163 www keyestudio com We make a flow chart based on the above logic table as shown below 2 Connection Diagram...
Страница 172: ...172 www keyestudio com 2 Flow chart 3 Connection Diagram...
Страница 182: ...182 www keyestudio com 2 Flow chart 3 Connection Diagram...
Страница 210: ...210 www keyestudio com 3 Connection Diagram...
Страница 223: ...223 www keyestudio com Attention Confirm that every component is connected...
Страница 225: ...225 www keyestudio com Servo Motor Brown Wire Gnd G Red Wire 5v V Orange Wire 9...
Страница 226: ...226 www keyestudio com Bluetooth Module RXD TX TXD RX GND GND VCC VCC No need to attach to STATE and BRK pins...
Страница 227: ...227 www keyestudio com IR Receiver Module Sensor Shield G GND V VCC S A0...