RPi 05 - Detect Input Using Interrupts
Автор: tsbrownie
Загружено: 2019-02-02
Просмотров: 9455
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.
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: