How to Use Arduino Interrupts The Easy Way

preview_player
Показать описание
Have you ever wanted to take advantage of Arduino hardware and software interrupts but didn't know how? In this tutorial, I'll show you the basics of using an Arduino's interrupts the easy way - quickly setting up the pins and handling events with just a few lines of code. Implementing software or hardware interrupts can open up a world of possibilities for your robotic creations - adding an extra layer of sophistication that takes your Arduino project to the next level. So dive in and let's discover how we can harness the power of Arduino interrupts for our own projects!

Video Chapters:
0:00 Intro
1:04 Example Without Interrupts
7:26 Hardware Interrupts
20:00 Software Interrupts (with TimerOne library)
31:54 Wrap Up

Build & Code Along:

Some links included here are to affiliate sites. If you purchase something through them, I may earn a small commission — which costs you nothing! I am very grateful for your support when you use my links to make a purchase.

#arduinotutorial #arduinointerrupts #arduino #interrupts
Рекомендации по теме
Комментарии
Автор

5 minutes in to the video and I've already clicked the subscribe and like buttons. This is how all tutorials should be made. You are a most awesome teacher.

ZothiamaCF
Автор

You are one fantastic teacher! I am a former HP engineer (long ago!) and have finally reached a place in life where I can do this sort of thing just for fun.
Your videos are immensely helpful and entertaining to boot. Absolute goldmine.
Thanks for all that you do!

jdoedoenet
Автор

Easily the best Arduino tutorials I’ve seen on YouTube. I came for the interrupts, but I will definitely be watching more. A refreshing change from the usual content. Thank you!

SlotCarNomad
Автор

Rachel has a knack of being able to teach clearly - well done.

mikepower-lw
Автор

This is brilliant, for a 65 year old to finally understand how interupts work. Your upbeat way of describing how it works is just fantastic. I can now implement this in a few of my projects and also see if I can find information on doing a similar thing with the ESP32 to improve some of those projects. Thanks Rachel, I will certainly go through your videos and also subscribe. Regards, Geoff.

JumbleLane
Автор

Your descriptions are clear and enjoyable to watch. I didn’t yawn at all and no urge to nap which is common with the monotone streams I have endured. Showing the pitfalls and showing the process . Thank you for your stream.

shirleysharrock
Автор

Your explanation of things is so much clearer then any other I have found so far. Excellent job, thanks!

janskrdlant
Автор

EXCELLENT description of using interrupts. Very Good!!!

jtodora
Автор

I built a demonstration of a perpetual motion machine as my first project using an Arduino. "Perpetual Motion Machine?" The Arduino is very flexible and can even work with a power supply that is a half bridge rectifier. Looking forward to your next video.

kentharris
Автор

I'm new to Arduino but not new to programming, so I'm glad I found this channel. Most other sites for Arduino channels for newbies assume you know zero about programming and are unwatchable.

joemechanic
Автор

I found you searching for interrupts. Really enjoyed your video and the way you delivered the information. I can't say I enjoyed any others more. I struggled with button debounce using the hardware interrupt approach, but finally worked through the issues. I look forward to your other videos.

davidgorman
Автор

Very nice tutorial! I would just suggest a few corrections:

1. The Arduino Uno has no software interrupts, although they can be simulated by writing to an interrupt pin configured as output. The timers are hardware devices, and the timer interrupts are hardware interrupts.

2. The first parameter of attachInterrupt() is an “external interrupt” number. This is not the same as an interrupt vector number. FWIW, external interrupt number 0 is interrupt vector 2 (see the ATmega328P datasheet).

3. Only variables shared between ISR and regular code need to be volatile. In the example you give, buttonState should be local to the ISR, and doesn't need to be volatile.

4. Using millis() within an ISR is perfectly fine. You should not, however, expect millis() to get updated within the ISR, as it gets “frozen” when the interrupt is triggered.

edgarbonet
Автор

Great video. Might be worth mentioning a while loop with small 1ms delay as a non interrupt solution on the way to the interrupt solution. Also an internal timer is a hardware interrupt, software interrupts are generated directly by the microprocessor when it needs system tasks done - memory management, errors, crashes, etc

PammyStevensonEquest
Автор

As I watched this video, I thought to myself, I know this person from somewhere, but from where? So I googled and OF COURSE, it was All Girls Garage! I'm a car guy too. I don't know how a marketing person gets into Arduino code, but I'm really glad you did because you explained it in a way I can understand. What I'm doing is simple and you explained very nicely how to do it simply. Thank you for this.

ProfessorOzone
Автор

This is so incredibly easy to understand and paced at such a great rate! Thanks for the amazing video! Can't wait to learn more from you =)

miachristensen
Автор

Great video, you explained this so well! I've spent hours looking at other videos on timers and interrupts which just confused me. I'm just getting back into Arduino programming after a 5-year break, and this was a huge help with the project I'm working on.

aardito
Автор

You are well prepared, so good at teaching and fun to watch. Thank you for making it possible to watch without getting bored.

KenanYusufTemel
Автор

You are such a good teacher!!! This made interrupts so much easier to grasp, thank

emmamarx
Автор

!!!! Thank you. !!!! As you would say I now have no hair left after a day that I spent trying to get 3 led's to blink with one at a different rate....
They did blink but not to the timings I set no matter what I did or how I rewrote the They were very random at best no matter what I I definitely failed the class and was at the bottom of the grade... """" Interrupts"""" nice After watching you video multiple times and taking lot's of notes for later Ron....
My sketch now works as intended and I'm now a solid "'" A "" student....
To a dumb bum you are a angel, a little crazy but an absolute angel, ,, Thank

daviddossor
Автор

Thank you so much for this video. The way you explain things and your examples make it so easy for beginners like me to understand. Please never stop making videos like this lol. Thanks again.

elevatedviewstcl