LESSON 28: Tutorial for Programming Software Interrupts on Arduino

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 มิ.ย. 2024
  • You guys can help me out over at Patreon, and that will keep this high quality content coming:
    / paulmcwhorter
    This lesson shows you how to take your Arduino Projects to the next level by learning to incorporate software interrupts. You can find the code and links for this lesson at:
    www.toptechboy.com/arduino/ard...
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 219

  • @bassman2162
    @bassman2162 3 ปีที่แล้ว +9

    I watched the 68 lessons on the Arduino. I looked at this group of 36 lessons and thought it was a an old duplicate version of the 68 lessons. Boy, am I glad I decided to go through these as a review. There is so much more to learn here. I hope others will see this and not make the mistake I nearly made, skipping these 36 lessons.

  • @Marva123
    @Marva123 6 ปีที่แล้ว +37

    "Look at that, BOOOMMM, we programmed an interrupt", love the enthusiasm.

  • @richardankur3703
    @richardankur3703 6 ปีที่แล้ว +34

    Sir keep posting your video. Your lessons are the best.Love from India

    • @paulmcwhorter
      @paulmcwhorter  6 ปีที่แล้ว +9

      Will do. Thanks for the kind words.

    • @abbasahmad9681
      @abbasahmad9681 4 ปีที่แล้ว

      Sir i need help plz reply me its about arduino timer interupts

  • @Fogaata
    @Fogaata 5 ปีที่แล้ว +5

    Master of Masters, great patient delivery. Thank you for extending a hand to us beginners. Much appreciated.

  • @Sinister_Reaper
    @Sinister_Reaper 2 ปีที่แล้ว +1

    Best teacher ever, i've spent months and months trying to learn programming and have watched hundreds of videos and i learned more in the past 2 days watching your videos than i have in the past 4 months, your videos are much appreciated!!!

    • @paulmcwhorter
      @paulmcwhorter  2 ปีที่แล้ว +1

      Happy to help!

    • @Sinister_Reaper
      @Sinister_Reaper 2 ปีที่แล้ว

      @@paulmcwhorter i had a couple questions about a project im working on to build an ecu for my grandpa's truck he passed down to me, the ecu was water damaged and i havent been able to find any companies that were able to rebuild it. I feel i've got the injection side of it worked out but the injectors run on a hydraulic system that runs off motor oil, there is a high presssure valve that feeds the injectors and runs off an icp sensor that regulates it, i know the factory bases the pressure off of rpm, on cranking it requires 1v and from the valve should make 250psi and at idle 750 psi and up to 3000psi at redline, i was wonder how i could do this based on the cam hall effect sensor? I'm struggling with figuring out how i would program the variables

  • @TonySwitzerland
    @TonySwitzerland 3 หลายเดือนก่อน

    Excellent tutorial, clear language (perfectly understandable also for non native (E-) speaking folks). Thank you so much!

  • @320mb
    @320mb 2 หลายเดือนก่อน

    We are out here, I'm glad to have Learned more about Interrupts..... I played with this Sketch and had one Led blink at 1.5 seconds and the other blink every third of a second... Oh and I did use a variable for the delay as learned from newer Lessons. Thanks

  • @prathameshbarik
    @prathameshbarik 3 ปีที่แล้ว +5

    That's really amazing teaching. Thank you so much. I had difficulty understanding this concept from a very long time. Thank you.

  • @robertpendergast2620
    @robertpendergast2620 6 ปีที่แล้ว

    Another excellent tutorial. I enjoy your excitement when the sketch works too.

  • @BRIGHTLIGHTSIDE
    @BRIGHTLIGHTSIDE 5 ปีที่แล้ว +7

    Paul, thanks a lot for sharing your precious knowledge. You're a great teacher :)

  • @siddheshgawali7764
    @siddheshgawali7764 6 ปีที่แล้ว +1

    appreciated that u are showing steps for downloading and installing library

  • @user-st1ml9rl6b
    @user-st1ml9rl6b 6 ปีที่แล้ว +5

    I feel so grateful for his awesome video and he's so passionate about teaching useful things even though he doesn't really have to. I can also learn that kind of things from his tutorial

  • @ryansfamily
    @ryansfamily 6 ปีที่แล้ว

    Thank you! I watch all your videos and have learnt so much.! Please keep posting these

  • @waynewelshans1172
    @waynewelshans1172 6 ปีที่แล้ว

    Paul, fantastic video series! Happy to see you back (without the cough;)) and keep them coming! 2 big thumbs up from me

  • @andrewferg8737
    @andrewferg8737 3 ปีที่แล้ว +4

    Great lessons. You've really helped me progress in Arduino. Thanks!

  • @WaqasKhan-nd6sj
    @WaqasKhan-nd6sj 6 ปีที่แล้ว

    Really a next level ......much improved and step to better performance and accuracy. thanks Mr , Paul.

  • @1DR31N
    @1DR31N 3 ปีที่แล้ว

    What a great explanation carried out with patience. I enjoyed it a lot.

  • @lucamorini4072
    @lucamorini4072 4 ปีที่แล้ว

    Mr. Paul, really tahnk you for your help! In this quanrantine I have learnt so many things thanks to you!

  • @barunbasnet
    @barunbasnet 3 ปีที่แล้ว

    Always come back to Paul for the basics.

  • @patfacunla1687
    @patfacunla1687 ปีที่แล้ว

    Actually Paul, I have a stumbling stone for years that I am trying to solve. Now that I have seen your video I myself cannot believe that it is this so simple!! Booom thanks for teaching paul !!!

  •  7 หลายเดือนก่อน

    Very good and thorough tutorial on software interrupts -- big thank you!

  • @danjunk-DIY
    @danjunk-DIY 4 ปีที่แล้ว

    Now I understood the actual concept of an Interrupt ! I did it on my Arduino R3 just now. I am thrilled.

  • @yuriu8
    @yuriu8 4 ปีที่แล้ว +1

    OMG Paul. mate you nailed it. It's amazing how you explain this I read a lot of articles and watched a lot of vids buy how they explain is absolute rubbish. it like I am an expert they expect me to know everything before I watch the video. Yet you explain it in a very understanding way thank you.

  • @aberateklehaimanot9804
    @aberateklehaimanot9804 5 ปีที่แล้ว +2

    Thank you very much Sir.Your tutorials are the best.Thanks again for sharing.

  • @loptica62
    @loptica62 6 ปีที่แล้ว

    Now this is what I've been waiting for! Great stuff!

  • @dirtycrazy1361
    @dirtycrazy1361 6 ปีที่แล้ว

    Best video lesssons ever. And hoping more lessons from this playlist. Sir, keep uploading and we are pleasant be your students!!!!!

  • @bunberrier
    @bunberrier 5 ปีที่แล้ว

    Nice! My appreciation for Arduino continues to grow.

  • @TheJavaSync
    @TheJavaSync 3 ปีที่แล้ว

    I come across your video very late, sir, since I'm just hobbiest (not real programmer), your teaching is very awesome,
    Thank You very much

  • @rodnolasco
    @rodnolasco 5 ปีที่แล้ว

    Sir, two thumbs up. The best ever explanation. Thank you so much!

  • @ramink1990
    @ramink1990 6 ปีที่แล้ว

    thanks for sharing, the world needs more guys like you.

  • @gfodale
    @gfodale 6 ปีที่แล้ว +17

    @ 15:26 you state that void denotes a function. In truth, void denotes that the function has no return type. The parenthesis after the function name is what denotes an actual function.

  • @RishabChouhanFilms
    @RishabChouhanFilms 6 ปีที่แล้ว

    Your lessons are the best sir....
    Plz dont stop.....

  • @franciscalderbank8623
    @franciscalderbank8623 3 ปีที่แล้ว

    Thanks Paul for an informative tutorial. Subscribed.

  • @First.Last.99
    @First.Last.99 2 ปีที่แล้ว

    Amazing intro to the cideo! For real, learned so much thank you

  • @lhoussainhamadi8414
    @lhoussainhamadi8414 2 ปีที่แล้ว +1

    Thanks for all the courses you're providing to us.

  • @AshutoshSahuMRM
    @AshutoshSahuMRM ปีที่แล้ว

    Thanks sir, for such an easy to understand explanation

  • @TheZooman22
    @TheZooman22 2 ปีที่แล้ว

    Thanks for a great lesson. That worked out very well. I needed a quick overview of interrupts for an extra credit project in my class.

  • @DucatiMTS1200
    @DucatiMTS1200 ปีที่แล้ว

    Many thanks again Paul for an excellent education video. I'm starting to really enjoy all these videos. 👍👍

  • @santoshkawale21
    @santoshkawale21 5 ปีที่แล้ว +1

    Heartily thank you Paul McWhorter
    :)

  • @anwertalibakraa748
    @anwertalibakraa748 4 ปีที่แล้ว

    Thank you Mr. McWhorter , This was Helpful and all your lessons Helps me out , Keep the GOOD WORK ^.^

  • @jaccosam
    @jaccosam 4 ปีที่แล้ว

    Thank You !! Great lesson.
    Please continue.

  • @sourabhsharma9070
    @sourabhsharma9070 6 ปีที่แล้ว

    hi paul!.. LONg time........ur tutorials are the best on youtube.,and plz keep making them.

  • @rho35100
    @rho35100 6 ปีที่แล้ว +1

    Hi Paul. Glad to see you are back in to the Arduino tutorials. I will need to pick that up my self again

    • @paulmcwhorter
      @paulmcwhorter  6 ปีที่แล้ว +2

      Yes, I have spent some time on the CAD software. I really think being able to design and print mechanical things for our electronics projects is a cool capability. So, I dont think time on Fusion360 was wasted. Hope to do a little more Arduino now.

    • @rho35100
      @rho35100 6 ปีที่แล้ว

      Paul McWhorter . Absolutely right The fusion 360 lessons where great and now I don't use inventor anymore, only Fusion360 , I even bought the License because I use it at work . And bought a 3dconnexion 3dmouse to work with it. Best thing ever

    • @EddieFox
      @EddieFox 4 ปีที่แล้ว

      @@paulmcwhorter Hello. I enjoy your videos and I merely tinker with code, knowing not even the basics really. I'm asking if you would consider helping me with some code? A friend asked me to build him a speedo for his model boat racing club. Like a fool I said, "yes" but I couldnt tell you how many rabbit holes and dead ends I've been down. I've finally found a code that sorta works but won't quite fit my (our) need. Part of it is to do with interrupts which I'm just not bright enough to sort out. I won't give the code or problem here because I ask politely and await your reply. (I've some technical knowledge. Check my channel if you have time.). God bless you anyway.

  • @Thefarnworth1
    @Thefarnworth1 5 ปีที่แล้ว

    A most excellent tutorial, once again thank you.

  • @zalllon
    @zalllon ปีที่แล้ว

    Really good teaching and explanations, I enjoy the way you present the information. I realize this video is quite old now, but I only just started getting into Arduino as of three weeks ago. Before that I hadn’t even heard of it, and I’m only familiar with programming because I use it in Microsoft excel in Microsoft access.

  • @great136
    @great136 4 ปีที่แล้ว +2

    sir we love your teaching,i first learned arduino from you,sir pls teach us to the end of the arduino,god bless u sir

  • @surajd2366
    @surajd2366 6 ปีที่แล้ว

    sir, thank you for continuing the playlist. pplz keep posting your videos.

  • @studentofedison421
    @studentofedison421 2 ปีที่แล้ว

    Hard topic explained in a crystal clear way, thank u so much

  • @supersuperintendant
    @supersuperintendant 3 ปีที่แล้ว

    My favourite teacher on TH-cam :)

  • @richardalford1740
    @richardalford1740 3 ปีที่แล้ว +1

    Is this part of a HS class? Damn, may need to go back to HS. lol. Have EE degrees and spent my career as an applied mathematician in Geophysical Research. Watching this series I'm beginning to feel like an EE. lol. Keep up the great work. It's a great time to be alive.

  • @tinnguyen1375
    @tinnguyen1375 4 ปีที่แล้ว

    This is exactly what I was looking for the last few days!! I was wondering how to dim the different colors of the RGB Led independently, so the color change randomly. Thanks!

  • @dmeadows11
    @dmeadows11 6 ปีที่แล้ว

    The Best of all the internet and that is big, These lessons are just Fantastic

  • @michaellmanashrove2615
    @michaellmanashrove2615 6 ปีที่แล้ว

    Thanks for all the hart work
    you are one of the best teachers
    Keep going with the good work

  • @alanlacey9437
    @alanlacey9437 10 หลายเดือนก่อน

    You Sir are a great teacher

  • @kavindugilshan
    @kavindugilshan 6 ปีที่แล้ว

    super clean explanation
    thank you sir !!

  • @sameerk12982
    @sameerk12982 4 ปีที่แล้ว

    Thank you Sir for this helpful tutorial...

  • @christianhdez
    @christianhdez 6 ปีที่แล้ว

    I like the way you teach, thank you.

  • @srinivasprasanth8703
    @srinivasprasanth8703 3 ปีที่แล้ว

    thanks for your excellent explanation sir.

  • @peterryder7874
    @peterryder7874 5 ปีที่แล้ว

    def giving this a thumbs up .. well done

  • @Steve-GM0HUU
    @Steve-GM0HUU 3 ปีที่แล้ว

    Very informative - thank you.

  • @alejandroperez5368
    @alejandroperez5368 6 ปีที่แล้ว

    Great tutorial, keep making more Arduino videos please!

  • @paulmeistrell1726
    @paulmeistrell1726 3 ปีที่แล้ว

    Thanks for the lesson Paul. Introduction to another #include!

  • @soloveyandriy
    @soloveyandriy 4 ปีที่แล้ว +2

    Hi Paul,
    Thank you for your lessons! They are the most comprehensible tutorials on Arduino that I`ve encountered on the Internet so far. I feel jealous of your students :)
    I have a question on this one. How many interrupts can we use in one an the same program?

  • @MrKvarkk
    @MrKvarkk 2 ปีที่แล้ว +2

    Paul, thanks for your great work. It would be great if you shoot a series of lessons on low-level Arduino programming - working with port registers, hardware timers etc. I mean direct Atmega registers usage, without any libraries.

  • @AliRashidi97
    @AliRashidi97 2 ปีที่แล้ว

    That was great!!! I suggest you add these few final lessons to "new arduino" playlist.

  • @andymouse
    @andymouse 6 ปีที่แล้ว

    great stuff Sir !...……..this has got me thinking...……….cheers

  • @zekeriasvarg530
    @zekeriasvarg530 6 ปีที่แล้ว +3

    I like using millis() and do the thinking from a-b my self to not get confused , but I understand that people like to put in librarys.

  • @mtzmechengr5781
    @mtzmechengr5781 2 ปีที่แล้ว

    Nice explanation!!

  • @kashifnoori6834
    @kashifnoori6834 6 ปีที่แล้ว

    Amazing 👌! Love from India 💞

  • @abdurrahmandogan621
    @abdurrahmandogan621 5 ปีที่แล้ว

    Very clear explenation...

  • @gabrielefugazzi579
    @gabrielefugazzi579 5 ปีที่แล้ว

    Amazing lesson

  • @toptechboy007s
    @toptechboy007s 2 ปีที่แล้ว

    thanks you SIR Paul

  • @imretoth8150
    @imretoth8150 6 ปีที่แล้ว

    me : Oeh a new Paul McWhorter vid, automatically checks it out

  • @davewreski6900
    @davewreski6900 4 ปีที่แล้ว

    Sinply put : Great Thank Paul

  • @engineereverything9055
    @engineereverything9055 2 ปีที่แล้ว

    excellent video !

  • @YouCanFixIt
    @YouCanFixIt 11 หลายเดือนก่อน

    Thank you for taking the time to explain could you use this to grab input high or low from another pin to use as a trigger to turn off another pin. As opposed to using mills function.

  • @MadMrQ
    @MadMrQ 2 ปีที่แล้ว

    Really interesting lesson.

  • @davypeleman3672
    @davypeleman3672 4 ปีที่แล้ว

    thanks very good lessons

  • @billgaytes6845
    @billgaytes6845 4 ปีที่แล้ว +2

    For someone is trying to learn 'C' after spending decades in assembler this is the best tuition I have ever seen.

  • @erygion
    @erygion 4 ปีที่แล้ว

    Great video Mr. Mcwhorter. Learned a lot, software interrupts are fairly new to me. Only thing I'm confused on is do the two loops run one after the other (linear) or separately in the code? Can two loops run at the same time ( I know arduino only has one "core")

  • @alexk6585
    @alexk6585 4 ปีที่แล้ว

    Salute to the gentleman! Makes it easy to understand!
    Any chance you can do a lesson related to blynk(app) coddling?

  • @jenniferw8963
    @jenniferw8963 ปีที่แล้ว

    1:45 you could set the delay for 250ms (instead of 1000ms) for the yellow led and use a counter variable for the redled. Increment the counter every 250ms. Once the counter reaches 4 you'd turn on the red led and set counter back to 0.

  • @anuragagarwal5480
    @anuragagarwal5480 5 ปีที่แล้ว +2

    Why does the yellow LED keep on toggling even if it is present in void setup(). Why don't it after return statement, go to the void loop() and continue its execution there ?

  • @ingeborgsvensson4896
    @ingeborgsvensson4896 4 ปีที่แล้ว

    Great video, thanks. What if the main loop generates a for example 1 kHz PWM signal, will the interrupt cause it to slow down a little causing it to become effectively 998 or 999 Hz for instance?

  • @mechsparks
    @mechsparks 5 ปีที่แล้ว

    Awesome video 👍

  • @jamesriopelle5197
    @jamesriopelle5197 6 ปีที่แล้ว

    Thank you, prof. McWhorter. Trying to figure out relationship between LEDStatus ="OFF" and DigitalWrite(YellowLED, LOW); Also am trying to figure out how to apply these principles to my own mission--to program arduino to read time intervals between a series of photogates with intention of measuring rate of slowing (derivative of speed) of a ball that has rolled down a ramp onto a flat continuation of the track; comparing balls of different materials (densities).

  • @maniacatthecontrols
    @maniacatthecontrols 6 ปีที่แล้ว

    Thank you this should help with what I want to do. I want to monitor a battery charger. It has a slow flashing LED's to say it is charging a battery but it flashes quickly if the battery is not charging. If it is not charging, you usually need to disconnect the battery and reconnect it again. Sometimes it starts to charge then gives up in after a minute or so. Then you need to try again and watch it for a while and see if it's going to keep charging. Sometimes you need to disconnect and reconnect the battery a few times before it will charge so I thought I'd use an Arduino to monitor it for me and a relay to disconnect and reconnect the battery. Then maybe add a sounder to say when the battery is charged when the LED stays on. So I'm reading what the LED is doing, rather than writing to it but I think I can work out how to do than from your videos. Thank you very much.

  • @Fernando53RJ
    @Fernando53RJ ปีที่แล้ว

    Good Job! Thanks a lot!

  • @nischalsehrawat2130
    @nischalsehrawat2130 6 ปีที่แล้ว

    Hi Paul, Can you make some videos about sensor communication protocols like I2C, UART, Single wire communication etc please?

  • @elektrocrafter1030
    @elektrocrafter1030 5 ปีที่แล้ว +1

    Verry Nice Video. But i have a Question: I want to make my interrupt after one minute, but the interrupt comes after 9-10 seconds? How can i fix this?

  • @lamorimferreira
    @lamorimferreira ปีที่แล้ว

    First of all my congratulations for your videos! I have a question, why there isn't a return in the second IF from the void BlinkYellow function, it returns automatically?

  • @bassman2162
    @bassman2162 3 ปีที่แล้ว

    I am interested in setting up a weather station using the Arduino. I had wondered how to get events to interrupt the main flow of the loop. I can see that I will need both software and hardware interrupts.

  • @danljohnston
    @danljohnston 4 ปีที่แล้ว

    Hey Paul, Using a Nano, can I have 2 interrupts at the same time? I want to get 2 RPM reading using Hall Effect Sens. Thanks for making these videos for the Adruino. Great for us who will never be "programmers".

  • @VipinKumar-mf5lv
    @VipinKumar-mf5lv 6 ปีที่แล้ว

    Sir, can more then 1 interrupts can apply in single Arduino program.
    The code you write use of single interrupts to blink a single led.
    If I want 3 to 4 interrupts led ON and OFF along with main loop running.
    Interrupts can work.

  • @reneg5325
    @reneg5325 4 ปีที่แล้ว

    would be nice also to get the info how to use a new library, how do we know what instruction is supported by a new library

  • @sanjaybhatikar
    @sanjaybhatikar 4 ปีที่แล้ว

    About the two LEDs blinking at different frequency, can you not use a clock and then use elapsed time with if statements to orchestrate activities?

  • @ashkannikfarjam9631
    @ashkannikfarjam9631 3 ปีที่แล้ว

    Hi I really like your videos. I was wondering if there is a way to have timer1 constantly running?

  • @Skilteskoven_Decal
    @Skilteskoven_Decal 3 ปีที่แล้ว +1

    Keep up the good work :-). Suggestion: How about replacing all the code in your interrupt routine with this: digitalWrite(YellowLED,!digitalRead(YellowLED)); that would make the code a bit shorter :-)

  • @sanjaybhatikar
    @sanjaybhatikar 4 ปีที่แล้ว

    How does this compare with using a countdown timer using the millis() function and triggering LED on/off commands based on time elapsed?

  • @tobechukwublessed4274
    @tobechukwublessed4274 2 ปีที่แล้ว

    Hello Mr. Paul, thanks for your video. I've been searching for this, and it really does help. But, can I still use this approach to control three different actuators (one servo, one linear actuator (through 4channel low trigger relay) and another DC submersible water pump (through 1 channel low trigger relay). I'm seriously trying to figure out how to control these actuators simultaneously. It's definitely going to involve hardware interrupts cause, the sensors attached to these actuators through the Microcontroller (nano) will change state occasionally. Could you assist me, if you've gotten a grasp of what I want to do, I'd really acknowledge that!