Arduino basic ep.1: Replacing delay() with millis()

preview_player
Показать описание
This video explains why the usage of the delay() function is very limited, and we should use the millis() function instead. This should be the very basic step of learning arduino because any circuit that requires more than one process (like monitoring a sensor/button and controlling an actuator) cannot use delay(), and should use millis() instead.
Рекомендации по теме
Комментарии
Автор

thanks for this video. I'm learning Arduino and english at the same time :D

Manu_D
Автор

GREAT tutorial video!!!! Have some input if you don't mind. How about adding some "splash screen" and introduction about you? And also IMHO, code needs a little bit more time :P. Just my 2cents though... Really easy to understand :D

rheza_h
Автор

Idk if youre still active, but..

Say I only want the LED to blink if a button is not active. Is there a way to have a function only run when a button is low? I tried:

if(digitalRead(button == LOW)) { //if the button is not pressed
flashBlue() //function that blinks the LED
}

It didnt work. It says flashblue() was not declared in this scope.

RalphV
Автор

haven't done any arduino programming before, where can i find your code..? Btw, can't i just do something like
int oldcounter = 0;
int counter = millis - oldcounter ;
then on the loop, you just say
if( counter < 500) {ON};
else if(counter<800){OFF};
else(old counter = millis)


PS: I love detective conan..

mikeholt
Автор

tutorial is good..but the code is over complicated.

samj