Перейти к содержимому

RPi 05 - Detect Input Using Interrupts

tsbrownie

0:00 / 0:00

RPi 05 - Detect Input Using Interrupts

9 554 просмотра · 7 лет назад
tsbrownie
38,8 тыс. подписчиков
9 554 просмотра · 7 лет назад
The 2nd experiment using an Infrared LED and Sensor to detect inputs on a Raspberry Pi, this time using interrupts in Python 3 with much faster / more reliable detection. Interrupts are interesting because it allows the Pi to carry on with 1 program while waiting for a real-time trigger to tell it to do something else immediately. It works until it is *interrupted* to perform a higher priority task. A relatively simple python program allows you to power the LED and use the photodiode to detect any interruption of the IR beam. Can be used for counting, detection of objects, location of moving parts, etc. MATERIALS IR photodiode IR LED 330 ohm resistor x2 1M ohm resistor Jumpers Breadboard Raspberry Pi WARNING: Warning: mis-wiring or mis-programming your Pi or miswiring of accessories can ruin the Pi and accessories. Information/drawings offered as is. Use at your own risk. If you don't know, learn first. Re-edit for annotations.