Тёмный
No video :(

Arduino Delay Function - Tutorial on Software Interrupts, Timer Library & Alternatives to Delay 

EEEnthusiast
Подписаться 41 тыс.
Просмотров 14 тыс.
50% 1

An Arduino delay can ruin your code. Knowing how to leverage software interrupts as well as Arduino timers as alternatives to Arduino delay calls critical. We will be looking at the Arduino Timer Library as well as examples of Software Interrupts and how you can eliminate the pesky Arduino delay function.
The demo in the tutorial is an LCD screen which receives data sent by the microcontroller with regards to a potentiometer. We will be discussing how we can eliminate the delay() call and which drawbacks each of the methods will have on our code.
Contribute to the channel:
/ ee_enthusiast
Hardware Used:
Arduino Uno R3: amzn.to/2MfOY6h
Breadboard: amzn.to/2tkwH0u
Potentiometer Kit: amzn.to/2ts5Nnx
LCD 16x2: amzn.to/2MSpb58
Software Used:
Online Arduino Editor
Get in touch:
Facebook: / eeenthusiast
Twitter: / ee_enthusiast
Instagram: / ee_enthusiast
Website: eeenthusiast.com
GitHub: github.com/VRo...
Personal website: vladromanov.com
Relevant Search Terms:
Arduino delay, arduino delay function, arduino software interrupt, arduino timer, arduino timer interrupts, arduino timer library, arduino delay alternative, arduino delay timer, arduino time delay, arduino interrupt timer

Опубликовано:

 

28 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 21   
@EEEnthusiast
@EEEnthusiast 6 лет назад
Hi everyone, I'm trying to figure out if we need an electronics forum. I've tried it before but didn't spend nearly enough time on it as it would require. Is anyone interested in having another forum? Looking for any thoughts, suggestions, etc.
@VasilisKarastergios
@VasilisKarastergios 6 лет назад
Excellent tutorial thanks for sharing it with us, I am going to be using interrupts in my future projects, I was using the polling method so far to update my sensors for a diy pellet burner machine. I hope you can cover in the future pid control.
@EEEnthusiast
@EEEnthusiast 6 лет назад
That's actually on my list of topics. I work with PID control on a regular basis on Allen Bradley PLC system, but have never actually implemented them on Arduino. I'll do some more research and release something soonish. Thank you for the suggestion!
@tralfazy
@tralfazy 2 года назад
Good one! Very useful. TY
@vladstrulev
@vladstrulev 4 года назад
Thank you Vlad. Excellent explanation.
@kingshahzad78
@kingshahzad78 5 лет назад
Nice explanation dear. I am using 6 sensor . One of these is AC voltage sensor for the detection of the AC Voltage magnitude but it is not giving right values how ever it is calibrated fine. What i observed is that this AC module works fine if it is single Arduino file but as a function it is not returning right value. i guess it is timing delay problem . What you say ?
@bassome3000ify
@bassome3000ify 4 года назад
thx again, u r awesome for sharing our experience
@dickbrock
@dickbrock 2 года назад
Thanks!
@abrahamsolomon1476
@abrahamsolomon1476 Год назад
By using software interrupt, can we attach interrupt in void loop instead of void setup ?
@TheJay6621
@TheJay6621 6 лет назад
Great Work.. Thanks for your time and efforts.. Super simple and very well explained.. It would be great if you cover Serial Interrupts. Like receiving Serial Data without polling it, and just doing routine work inside main loop.. Thanks again..
@EEEnthusiast
@EEEnthusiast 6 лет назад
Thank you for the feedback! I believe that serial data doesn't have an interrupt; it will poll once every "main" cycle and will start transmission only when the Arduino responds. So you'd be interested in a general tutorial on serial data? Thank you again.
@TheJay6621
@TheJay6621 6 лет назад
EEEnthusiast Serial Data do have interrupt. But Arduino doesn't have interrupt driven Serial data receiving(for user side ) it needs to be polled Everytime.
@EEEnthusiast
@EEEnthusiast 6 лет назад
That makes sense. I'll need to do some more research on it. I'm interested in buying a device which communicates over serial to see if i can test a few things.
@TheJay6621
@TheJay6621 6 лет назад
EEEnthusiast You may consider buying a Ublox or any other brand GPS module. It communicates over serial. And can be very handy for Location Based ptojects. There are GSM+GPS modules which gives cellular connection via SIM card with GPS.. Good luck..
@EEEnthusiast
@EEEnthusiast 6 лет назад
Those modules are much cheaper than expected. I just ordered the Ublox NEO-6M GPS Module for 6$ on ebay. Thanks for the tip Jay.
@wsmao1154
@wsmao1154 4 года назад
nice and clear
@Juan-fh5cv
@Juan-fh5cv 5 лет назад
Hi I need some help figuring out the interrupts I need to use for a wireless alarm on a garage door that is a distance away from a apartment i have built the hardware using nrf24l01 module that works fine but I want the alarm to only activate the buzzer for 5 seconds when the door has been opened then turn off activate it again for 5 seconds when the door has closed i have a trigger on the door that goes high when the door is oppened how can i achieve this? Please help
@CarlosCruz-ro5cm
@CarlosCruz-ro5cm 5 лет назад
Does interrupts work with serial monitor?
@WereReallyRelayCamping
@WereReallyRelayCamping 4 года назад
wow, just what i needed to find. and i like the pun at @09:48 This is going to solve all my problems... well ok not all. i need to pulse a pin between .5 and 6 times a second, with this i can just have a routine service 12 times a second, i can have a variable to see how many times it been called, compare that to a 2nd variable for 'required pulse' and if its reached, turn the pin on, then turn the pin off next time through just like the led. whats such an odd requirement for? i'm running a pump, each pulse will feed a set amount, to increase flow i need to increase the pulses, and it needs must not be affected by things in the loop changing that speed, ie waiting for a button press or a sensor to hit a value
@FactPulse-f4k
@FactPulse-f4k 6 лет назад
Great video.. You are such a nice man..Thanks dude
@EEEnthusiast
@EEEnthusiast 6 лет назад
Appreciate the kind comment! Thank you sir.
Далее
How to Use Arduino Interrupts The Easy Way
33:28
Просмотров 82 тыс.
The Fan’s Fang Skin🔥 | Brawl Stars Sneak Peek
00:16
Arduino Sketch with millis() instead of delay()
14:27
Просмотров 227 тыс.
I built my own computer. by hand.
13:03
Просмотров 1,2 млн
Level Up Your Arduino Code: Timer Interrupts
17:22
Просмотров 228 тыс.
How to Use Millis to Master Arduino Multi-tasking
50:17