arduino timer without delay() function

Share this & earn $10
Amal Anjula
Published at : 22 Dec 2020
2100 views
29
4

#arduino #nodelay #delay() #multitasking #timers
you can make individual 4 timers without using delay function. so no more lag your while loop. timer interval can adjust in millisecond
pls repalce (greaterthanSymbol) with real symbol. because this you tube not allow greaterthanSymbol in description

#define timer1_time_out_in_milliSeconds 1000
#define timer2_time_out_in_milliSeconds 2000
#define timer3_time_out_in_milliSeconds 5000
#define timer4_time_out_in_milliSeconds 10000
uint16_t mil1, mil2, mil3, mil4, mil5;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if (millis() - mil1 (greaterthanSymbol) timer1_time_out_in_milliSeconds) {
mil1 = millis();
Serial.println("Um 1000ms");
// put ur 1 seconds routing here
}
if (millis() - mil2 (greaterthanSymbol) timer2_time_out_in_milliSeconds) {
mil2 = millis();
Serial.println("Um 2000ms");
// put ur 2 seconds routing here
}
if (millis() - mil3 (greaterthanSymbol) timer3_time_out_in_milliSeconds) {
mil3 = millis();
Serial.println("Um 5000ms");
// put ur 5 seconds routing here
}
if (millis() - mil4 (greaterthanSymbol) timer4_time_out_in_milliSeconds) {
mil4 = millis();
Serial.println("Um 10000ms");
// put ur 10 seconds routing here
}
}
arduino tutorialhow toarduino lesson

BIRTHDAY SURPRISE! They Knew EXACTLY What I Wanted, Emotional

BIRTHDAY SURPRISE! They Knew EXACTLY What I Wanted, Emotional

Ripple XRP: 3 Paths For XRP Success & Why Brad Garlinghouse Thinks BTC’s Success Is Crucial

Ripple XRP: 3 Paths For XRP Success & Why Brad Garlinghouse Thinks BTC’s Success Is Crucial

Folk being inquisitive about pet battles.

Folk being inquisitive about pet battles.

11:00 AM - RRB NTPC 2019-20 | Maths by Sahil Khandelwal | Average (औसत)

11:00 AM - RRB NTPC 2019-20 | Maths by Sahil Khandelwal | Average (औसत)

Insufferable - The Abandonment Of Musicality [2019 Noisegrind]

Insufferable - The Abandonment Of Musicality [2019 Noisegrind]

ЗАБУСТИТЕ НА МИФ СЛАВУ| MOBILE LEGENDS

ЗАБУСТИТЕ НА МИФ СЛАВУ| MOBILE LEGENDS

I Really Like You - Carly Rae Jepsen - MAX & Against The Current Cover

I Really Like You - Carly Rae Jepsen - MAX & Against The Current Cover

Message from Danny Kortchmar of The Immediate Family

Message from Danny Kortchmar of The Immediate Family

Marine Girls - A Place in the Sun (Official Video 1983)

Marine Girls - A Place in the Sun (Official Video 1983)

THE YANK Official Trailer [Comedy 2016] HD

THE YANK Official Trailer [Comedy 2016] HD

Asma-ul-Husna (99 Names of Allah) | أسماء الله الحسنى‎

Asma-ul-Husna (99 Names of Allah) | أسماء الله الحسنى‎

Someday You'll Lose Everything -Robert Kiyosaki

Someday You'll Lose Everything -Robert Kiyosaki

ZAYN, Zhavia Ward - A Whole New World (End Title) (From "Aladdin")

ZAYN, Zhavia Ward - A Whole New World (End Title) (From "Aladdin")

This is HUGE! - The Secrets/details of YOUR NEXT Dirt Bike!

This is HUGE! - The Secrets/details of YOUR NEXT Dirt Bike!

2020 Trophy Lodge Tour! | Almost a Year's Worth of Trophies!

2020 Trophy Lodge Tour! | Almost a Year's Worth of Trophies!

CLOTHING HACKS TO UPGRADE YOUR WARDROBE || Clever DIY Clothes Fixes And Folding Ideas by 123 GO!

CLOTHING HACKS TO UPGRADE YOUR WARDROBE || Clever DIY Clothes Fixes And Folding Ideas by 123 GO!

Math 2A. Calculus. Lecture 05. Tangents, Slopes, and Limits.

Math 2A. Calculus. Lecture 05. Tangents, Slopes, and Limits.

The risks from Covid-19 | DW Documentary

The risks from Covid-19 | DW Documentary

XL Specialized Trailers Mechanical Neck Operating Instructions

XL Specialized Trailers Mechanical Neck Operating Instructions

Steven Universe | Stronger Than You - Estelle Performs LIVE (MUSIC VIDEO) | Cartoon Network

Steven Universe | Stronger Than You - Estelle Performs LIVE (MUSIC VIDEO) | Cartoon Network

HelloHero AllStars:Idle League (Gameplay Android)

HelloHero AllStars:Idle League (Gameplay Android)

Addiction

Addiction

Darknights | DM-EX-6 | Arts of War

Darknights | DM-EX-6 | Arts of War

NE-YO - NE-YO – PUSH BACK (Jimmy Kimmel Live!/2018)

NE-YO - NE-YO – PUSH BACK (Jimmy Kimmel Live!/2018)

When Feeling Disillusioned With Life

When Feeling Disillusioned With Life

Here lies Jester Palette From the Profusion Halloween Collection!!!!

Here lies Jester Palette From the Profusion Halloween Collection!!!!

Preview: Anne Klinge sweeps the Judges off their feet

Preview: Anne Klinge sweeps the Judges off their feet

The Consequences of Excess Liquidity: Sovietization & Complacency

The Consequences of Excess Liquidity: Sovietization & Complacency

I ATTEMPT TO DO MY MAKEUP IN ASMR....ENJOY

I ATTEMPT TO DO MY MAKEUP IN ASMR....ENJOY

Consult with Dr. Kumar | Quick Symptoms List

Consult with Dr. Kumar | Quick Symptoms List

HOW TO ELEVATE YOUR STYLE | 11 TIPS

HOW TO ELEVATE YOUR STYLE | 11 TIPS

Зачем вообще нужен оборот THERE IS/THERE ARE? (не для начинающих) [НЕУ #16]

Зачем вообще нужен оборот THERE IS/THERE ARE? (не для начинающих) [НЕУ #16]

Telephone bloopers and lost video.

Telephone bloopers and lost video.

Looking at me•It took me by surprise•Human•Class fight(4 is 1)||GLVM||Gacha Life

Looking at me•It took me by surprise•Human•Class fight(4 is 1)||GLVM||Gacha Life

Regarding the rumors about me today

Regarding the rumors about me today

How to look hot and conceal!

How to look hot and conceal!

◄ FICTIONAL STARSHIPS Size COMPARISON ► 3D 🛸

◄ FICTIONAL STARSHIPS Size COMPARISON ► 3D 🛸

The Computer That Could Be Smarter Than Us [IBM Watson]

The Computer That Could Be Smarter Than Us [IBM Watson]

എന്ത് കൊണ്ടാണ് DTH ചാനലുകൾ മഴയത്ത് കിട്ടാതാകുന്നത് | Why DTH Affected By Rain / Bad Weather?

എന്ത് കൊണ്ടാണ് DTH ചാനലുകൾ മഴയത്ത് കിട്ടാതാകുന്നത് | Why DTH Affected By Rain / Bad Weather?

𝓭𝓮𝓶𝓸𝓷 𝓲𝓷 𝓪𝓵𝓵 𝓪𝓵𝓹𝓱𝓪 𝓼𝓬𝓱𝓸𝓸𝓵 (1/?) ❤️ (𝓖𝓛𝓜𝓜)

𝓭𝓮𝓶𝓸𝓷 𝓲𝓷 𝓪𝓵𝓵 𝓪𝓵𝓹𝓱𝓪 𝓼𝓬𝓱𝓸𝓸𝓵 (1/?) ❤️ (𝓖𝓛𝓜𝓜)

Electricity: Crash Course History of Science #27

Electricity: Crash Course History of Science #27

[HD] 2.0 Hot Wheels AcceleRacers: The Speed Of Silence - english

[HD] 2.0 Hot Wheels AcceleRacers: The Speed Of Silence - english

Earn $97 Per Friend You Refer (No Limit) - Money Making Apps 2020

Earn $97 Per Friend You Refer (No Limit) - Money Making Apps 2020

The One thing you must do if Charged with a Criminal Offense in Pittsburgh Pennsylvania

The One thing you must do if Charged with a Criminal Offense in Pittsburgh Pennsylvania

Your Little Cat 2 - "You Possibly Can't Say That this isn't Cute." | Dash Reacts

Your Little Cat 2 - "You Possibly Can't Say That this isn't Cute." | Dash Reacts

Dr Mundo but I actually try and heal my team because I am a doctor obviously lmaooo

Dr Mundo but I actually try and heal my team because I am a doctor obviously lmaooo

Rarri True - "Factual" (Official Music Video) Film By @ArieeBill

Rarri True - "Factual" (Official Music Video) Film By @ArieeBill

How to Analyze Negligence on a Torts Essay (Pt. 2): The Reasonable Person Standard of Care

How to Analyze Negligence on a Torts Essay (Pt. 2): The Reasonable Person Standard of Care

The Heights - How Do You Talk To An Angel (Official Video)

The Heights - How Do You Talk To An Angel (Official Video)