In this video, we will talk about external interrupts INT0 and PCINT. The video will demonstrate examples in C and using libraries for the Arduino IDE.
First, let's talk about how to work with the INT0 interrupt using the functions of the Arduino IDE development environment. And then I will give an example sketch for working with INT0 using registers. The examples will be on the ATtiny13 microcontroller.
After that, we will analyze two sketches working with PCINT. With one and two buttons. Both sketches are in C with direct control of microcontroller registers.
At the end, I will show a library that allows you to use functions to work with the PCINT interrupt instead of registers.
Library for working with PCINT https://github.com/NicoHood/PinChange...
Sketches:
Arduino INT0 Interrupt https://drive.google.com/file/d/19zoL...
Interrupt INT0 C++ https://drive.google.com/file/d/1cYza...
One button PCINT C++ interrupt https://drive.google.com/file/d/1EDgf...
PCINT C++ interrupt with two buttons https://drive.google.com/file/d/1C3vi...
Arduino PCINT interrupt with two buttons (not working) https://drive.google.com/file/d/1dbI1...
0:00 External interrupts INT0 and PCINT
3:39 Hardware interrupt INT0
7:52 PCINT interrupt
12:30 Connecting 2 or more buttons
13:29 Library for working with PCINT