background image

Elecrow on-line store, make your making easier.

https://www.elecrow.com/

Material:

Micro:bit

x1

Crowtail- Base Shield for Micro:bit

x1

Crowtail- IR Reflective Sensor

x1

Crowtail- Buzzer

x1

Lesson14. IR Distance Measurement

If we can make some tools that can measure the distance , it sounds very interesting .This Lesson
will teach you use IR to detect short distance. Connect the Crowtail- 80cm Infrared Proximity
Sensor to P0 interface, then upload code, aim the probe at the front object, you will view the
distance between the probe and the object, which show on the LED dot matrix.
Note

Distance measuring range: 10 cm to 80 cm

let

value =

0

basic

.

forever

(() => {

value =

pins

.

digitalReadPin

(DigitalPin.P0)

if

(value) {

pins

.

digitalWritePin

(DigitalPin.P1,

1

)

}

else

{

pins

.

digitalWritePin

(DigitalPin.P1,

0

)

}
})

Содержание CRT45259M

Страница 1: ...not enough That s why we introduce the Crowtail Start Kit for micro bit to you The crowtail start kit for micro bit can make you do a lot of interesting things and brings endless possibilities to you...

Страница 2: ...y ON OFF 7 Lesson7 Soil Moisture Detection 8 Lesson8 Sound Detection 9 Lesson9 Breathing LED 10 Lesson10 Servo Calibrator 11 Lesson11 Magnetic Field Detection 12 Lesson12 Control the MOSFET as a Switc...

Страница 3: ...bit x1 Crowtail Base Shield for Micro bit x1 Crowtail LED x1 Sofware Lesson2 Brightness Measurement Our eyes can sense the brightness of the light but it not a accurate value just a sense now let us...

Страница 4: ...r x1 Sofware Lesson3 Make a Beeping Noise This Lesson teach you how to use a buzzer with Micro bit Connect the Crowtail Buzzer to P1 interface after you upload the code into the micro bit you will hea...

Страница 5: ...e motor rotation As we know the motor need a large current to drive itself so we need a mosfet to control the motor run and stop Connect the Crowtail MOSFET to P1 interface and connect the DC motor to...

Страница 6: ...ion sensor to detect movement then with other parts can do many interest application Connect the Crowtail PIR sensor to P2 interface and connect one LED to P1 interface then upload the code when a per...

Страница 7: ...e in our daily life so we must to know how to use it Connect the Crowtail Relay to P1 interface then upload the code into Micro bit you will hear a mechanical on off sound from the relay every 2 secon...

Страница 8: ...s but not know when and how much to watering the plants so this lesson will teach you detect the soil moisture Connect the Crowtail Moisture sensor to P0 interface then upload the code into micro bit...

Страница 9: ...bly it will play a huge role in the field of intelligence this lesson will teach you detect the sound as a switch to power on one LED Connect the Crowtail Sound sensor to P1 interface and connect one...

Страница 10: ...r to adjust the PWM frequency the LED will light brighter and brighter then light darker and darker which is like breathing Connect the crowtail LED to P0 interface and connect the crowtial liner pote...

Страница 11: ...se buttons to control the servo with different rotating angle and you can view the current angle from the LED dot matrix Connect the Crowtail Servo to P0 interface then upload the code into micro bit...

Страница 12: ...gnetic sensor close to the magnet it will have response and the LED will light on Connect the Crowtail Magenet switch to P0 interface and connect the crowtail LED to P1 interface let angle 0 input onB...

Страница 13: ...high speed response and high stability we usually use it as a switch in some application this lesson will teach you how to control the MOSFET on off Connect the crowtail MOSFET to P0 interface and co...

Страница 14: ...e is the basic function this lesson will teach you how to use IR reflective sensor to detect obstacle Connect the Crowtail IR reflective sensor to P0 interface and connect the crowtail buzzer to P1 in...

Страница 15: ...interesting This Lesson will teach you use IR to detect short distance Connect the Crowtail 80cm Infrared Proximity Sensor to P0 interface then upload code aim the probe at the front object you will...

Страница 16: ...ponse characteristics so we usually use it in some exploration field Connect the crowtail microwave sensor to P1 interface then upload the code put the sensor in a quiet area if there is activity issu...

Страница 17: ...ght not need light all the time only when there are poor light and the pace of someone s footsteps then the light will on Connect the crowtail light sensor to P0 interface connect the crowtail sound s...

Страница 18: ...rst connect the Crowtail RTC to the IIC interface to get the real time then set the alarm clock rang time when the time is up the crowtail Buzzer will sound Connect the Crowtail RTC to P0 interface co...

Страница 19: ...rity in the movie in this lesson will teach you use microwave to built a Anti theft device if someone enter the detection area the alarm will sound Connect the Crowtail Microwave Sensor to P1 interfac...

Страница 20: ...mini Fan we can use a button to control the relay to switch the Fan on or off Connect the Crowtail Switch to P0 interface connect the Crowtail Relay to P1 interface connect the Fan to the other side o...

Страница 21: ...its moisture Connect the Crowtail Moisture Sensor to P0 interface connect the Crowtail Relay to P1 interface and connect the pump to another side of the Relay And use two pipe connect the water in an...

Страница 22: ...tore make your making easier https www elecrow com let item 0 basic forever item pins analogReadPin AnalogPin P0 if item 450 pins digitalWritePin DigitalPin P1 1 basic pause 20000 pins digitalWritePin...

Страница 23: ...Elecrow on line store make your making easier https www elecrow com...

Отзывы: