How to Use Interrupts on the Arduino - Ultimate Guide to the Arduino #24

preview_player
Показать описание
Use hardware and timer interrupts when you want the Arduino to perform multiple tasks at the same time. In this video we will use hardware and timer interrupts to control the blink rate of two separate LEDs at the same time.

This is tutorial #24 in the Ultimate Guide to the Arduino, a complete video course on the Arduino microcontroller with 45 lessons that are designed to teach anyone how to master the Arduino at any skill level. Visit our YouTube channel page to watch the entire series!

Get the 3-in-1 Arduino Smart Car and IOT Learning Kit from SunFounder here:

Or get the kit from Amazon:

Get an Arduino Uno from SunFounder here:

Visit the webpage for this video tutorial on Circuit Basics for wiring diagrams and example code:

And be sure to check out the Circuit Basics blog and social media for more articles and tutorials on the Raspberry Pi, Arduino and other DIY electronic projects!
Рекомендации по теме
Комментарии
Автор

This is a nice and informative video! I would just want to add two small corrections:

1. millis() works just fine inside an ISR. It won't increment while the ISR is running, but this is no issue: an ISR should normally run for far less than a millisecond, so you wouldn't expect it to increment anyways.

2. You should not qualify as `volatile` a variables that is local to the ISR: this is only for global variables shared between the ISR and normal code. And in this example, you certainly do *not* want `buttonState` to be stored in SRAM, as doing so only brings inefficiency, with not benefit.

edgarbonet
Автор

Have you ever try to use the Bluetooth module HM10??

egvideos
Автор

Thanks. Appreciated your nice explanation.

MrHbpatel