How to Use Millis to Master Arduino Multi-tasking

  Рет қаралды 62,683

Rachel De Barros

Rachel De Barros

Күн бұрын

Пікірлер: 189
@robertorusso3192
@robertorusso3192 Жыл бұрын
Hi Rachel, i saw many tutorials about millis, but no one was clear and effective like yours! Thank you!
@bikobika7319
@bikobika7319 11 ай бұрын
Hi Rachel I am not only an arduino learner, but I am also an english learner So I think I am lucky when I watch your videos because your clear accent and your explanation way Thanks
@RachelDeBarrosLive
@RachelDeBarrosLive 10 ай бұрын
I have a lot of fun doing these and learn new things too. 😄
@jasongrayston7450
@jasongrayston7450 11 ай бұрын
I teach high school robotics in Canada. You are a fantastic teacher! My kids are going to love the way you explain coding. I have a bunch of girls in my program who will be looking up to you as well! Thank you so much!
@jimjames7479
@jimjames7479 Жыл бұрын
she is what we think a real teacher should be like. she is the best educator out there.
@barleyhopps
@barleyhopps 11 ай бұрын
She reminds me of sex-ed teacher.
@Anointingify
@Anointingify 10 ай бұрын
Hi Rachel, I want to say your illustration of using millis with all in one example was just awesome. Your detailed example gave me a good understanding of this topic. Thank you very much.
@RachelDeBarrosLive
@RachelDeBarrosLive 10 ай бұрын
You are so welcome! Let me know how you make out.
@johnelder150
@johnelder150 2 ай бұрын
I'm really grateful for all your videos on how-to do things that can activate and control props. I'm especially grateful for your Arduino videos. It's been 20 years since I worked professionally on real-time projects, and I thought I'd forgotten how. But as I watch your videos, it is coming back to me. You're making an older gentleman really happy. But, millis() refers to milleeseconds, hence it should be called "millees". But I've found your videos so helpful, you can keep on calling it "milliss' forever, and I'll still be super grateful.
@petrosyrjala6908
@petrosyrjala6908 11 ай бұрын
You are the best at teaching arduino. You are a really efficient and lively person to teach with good examples. Thank you!
@elevatedviewstcl
@elevatedviewstcl 2 ай бұрын
Have learned a whole lot from you and Mr. Paul McWhorter. Please continue these Arduino tutorials.
@SaiksTech
@SaiksTech 10 ай бұрын
You made the whole lesson enjoyable with a unique approach. Bless dear!
@RachelDeBarrosLive
@RachelDeBarrosLive 10 ай бұрын
Thank you! 😃
@richardgoldston5922
@richardgoldston5922 10 ай бұрын
Hi Rachel, I am a radio engineer and I have just come across your vid's and love them so much,
@dannyyeoh2340
@dannyyeoh2340 6 ай бұрын
OMG, so a million thank you Rachel, been doing C++ programming and no one be able to explain clearly the difference between unsigned long and long and what unsigned variable is for. You explained it with sample to make it more clearer. Wow the servo moves so smoothly. I never get to move it so smoothly always there is some interruption. Your code is short, not winding and very simple to understand. Thank you so much for doing this tutorial.
@jansmit4628
@jansmit4628 11 ай бұрын
You are an entertaining and enthusiastic teacher. Found a small error I think in the servopos values which is declared as an integer. While incrementing its value it will run upto 181 before it decrements again. The servo will not run past 180 so will be there for 2 intervals. As servopos is declared as integer, it can become -1, which creates the same situation in the opposite position. In your demo nobody can see this, but when you really drive something serious with the servo you would notice. Your energy makes me want to pull the arduino out the drawer and play with it some more. Keep up your teaching sessions.
@SummersideDiver
@SummersideDiver 9 ай бұрын
Oh my god, this video just saved me. I had a fading led that stopped working when the servo was added, and I could not figure out what went wrong. Your explanation of the servo library messing with pin 10 helped so much. The way you explain code structure is also very straightforward. Thank you
@leonvita91uk
@leonvita91uk 6 ай бұрын
I love you, i never watch a video on youtube for 50 mins, max 20 mins, but your videos are so fun and i really really like them, you deserve my sub and like.
@sakshambhatnagar7386
@sakshambhatnagar7386 7 сағат бұрын
the way u explain sometimes feels magical😁
@banglarif
@banglarif Жыл бұрын
You are 24k gold. I like the way you teach. WOW. OMG
@RachelDeBarrosLive
@RachelDeBarrosLive Жыл бұрын
Thanks! 😃
@joebatista4306
@joebatista4306 Жыл бұрын
Hi Rachel, so glad i came across your channel, your presentation is so much more vibrant and intuative than others (i guess we learn better/ easier when we having fun). Will follow for all things arduino/ coding
@meach8551
@meach8551 4 ай бұрын
Thank you for this tutorial. I was struggling with millis(). So more how to link them together with other function. I really do appreciated it.
@janszal
@janszal Жыл бұрын
Great example, I was looking something like this for some time. Keep up the good work!
@gigsim7115
@gigsim7115 11 ай бұрын
I love the energie and the way you talk.
@ThierryC2373
@ThierryC2373 6 ай бұрын
Fantastic video, very well explained. I love the way you teach by doing the things along. Next level = include interruption for a certain period of time with a trigger within a function while permitting other tasks to continue, then resume the interrupted task.
@josepheccles9341
@josepheccles9341 Жыл бұрын
You are so much fun to watch. I have taken up using a library "elapsed millis" for many similar tasks. I started using that when I made an NHRA style Christmas tree like starts drag races. I use a single object to compare to for turning on and off each light. Before I was using industrial PLC's to make them, but those are expensive. But I have a lot more experience writing programs for those. Ladder logic is a lot more simple to write than C, or the similar found in arduino.
@DevSupport-d6g
@DevSupport-d6g 4 ай бұрын
Im new to Arduino programming this was really helpful thanks
@mattinkel7342
@mattinkel7342 9 ай бұрын
What and absolutely fantastic teacher you are Rachel.. it helps no end to see someone explain as they write the code and describe their thought process .. just wonderful. Never subscribed so fast and eager to learn more
@zk_6312
@zk_6312 9 ай бұрын
Great video. I have always stayed away from millis mostly as it can get so complicated, but you make it look easy. I will have to try this again.
@toeterdetoet539
@toeterdetoet539 Жыл бұрын
Forcably limiting myself to the technical questions. (I'm stunned)
@emmamarx9284
@emmamarx9284 3 ай бұрын
You are the besttt!! This made millis finally click in my head, thank youuuuuuuu ❤
@stradcar1
@stradcar1 Жыл бұрын
This is the best present I have ever watched guaranteed not to make you sleep.
@beachcomberbob3496
@beachcomberbob3496 10 ай бұрын
Now all we need to know is how we drop out of a void function once that function has reached a time limit (or number count). It would be cool to see the red LED turn off after 2 minutes, and/or switch on with a button, run for two minutes, stop again and wait for the next button press. Having said all that, your tutorials are crystal clear compared to a lot of guys on KZbin who head off into the weeds.
@MarioRossibless
@MarioRossibless 9 ай бұрын
I'm new in your channel. Excellents class. Your english is clear and expressive. Thank you
@keith726able
@keith726able 2 ай бұрын
Wow! Amazing explanation and demonstration of millis. You are a wonderful teacher. I subscribed.
@Mokkers_stuff
@Mokkers_stuff 7 ай бұрын
Hi Rachel. Thank you for posting such a great tutorial video. Have recently got back into Arduino programming with a view to controlling a model railway and associated accessories such as signals, uncoupling ramps and turnouts (or points as we call them here in the UK). This video is going to help me a lot! Loved the fact that you just dealt with syntax errors as they came up, those darned brackets get me every time too! And thanks for the tip about the servo library pin conflict, that was news to me. Great work!
@stever3886
@stever3886 Жыл бұрын
Hey Rachel, I snagged this note below from the Arduino reference page for analogWrite function. Your comment about some PWM pins being flakey made me do a little digging. In general pins 5 and 6 “may give” unexpected results? Notes and Warnings The PWM outputs generated on pins 5 and 6 will have higher-than-expected duty cycles. This is because of interactions with the millis() and delay() functions, which share the same internal timer used to generate those PWM outputs. This will be noticed mostly on low duty-cycle settings (e.g. 0 - 10) and may result in a value of 0 not fully turning off the output on pins 5 and 6.
@Samiby
@Samiby 9 ай бұрын
I think UNO just needs to disappear. So many tech issues with it. For the cheaper price, people need to start buying into more functional esp32 boards or something
@DARPunk
@DARPunk Жыл бұрын
You are just an amazing teacher!
@jimcraig5727
@jimcraig5727 3 ай бұрын
Great tutorial, great teaching style!
@chandramalsoysa3715
@chandramalsoysa3715 5 ай бұрын
Excellent tutorial. Very clear and helpful.
@flywittzbeats4008
@flywittzbeats4008 9 ай бұрын
I am now a state machine master! Haha thank you so much this is amazing.
@johnpfeffer1957
@johnpfeffer1957 10 ай бұрын
You're a good instructor! I learned 2 new things yesterday & today.
@JohnyRalte
@JohnyRalte Жыл бұрын
Thank you Rachel. Best explanation ever, especially int, long and unsigned long. Great video for curious beginners.
@christinamarks6349
@christinamarks6349 6 ай бұрын
Excellent (if you're not already, you should be teaching professionally). I've watched countless videos on this subject, but this is by far the most concise to date and, explained in language that anyone can understand! Keep Up The Great Work!
@Steve-xb7dn
@Steve-xb7dn 10 ай бұрын
Great video Rachel, love your energy and enthusiasm
@azmathismail1611
@azmathismail1611 6 ай бұрын
Hi Rachel. Great video and love your gripping enthusiasm to teach your passion to others. I'm a developer myself. Been wanting to get into Arduinos and electronics and also drag my daughter along the ride. I think we'll enjoy the ride much more with your videos 🙂
@elektron2kim666
@elektron2kim666 4 ай бұрын
Just started with the Arduino IDE and thought it was MicroPython for a few days and my app was already working (I'm a bit of a polyglot) and ran into more details for what I wanted, of course. It was not obvious with a special machine causing extra setup with libraries and similar with tests. Now I'm loving it and look into the correct places.
@pingfway1455
@pingfway1455 Жыл бұрын
It helps to me understand the millis() function better and thinking this may be a better solution for creating a multi-tasking for my agriculture system. A system to control the temperature and irrigation. Your cheering explanation made the presentation interesting and enjoyable. Thanks a lot.
@bigEratt
@bigEratt Жыл бұрын
Wow !..Just found your channel again, 👑 De Barros !..
@davidcamilleri288
@davidcamilleri288 Жыл бұрын
Hi Rachel, thanks to you I can manage my project better now because I was going crazy trying to use three infrared object sensors at the same time but could not manage to do it. now i am going to have a try following your program and then we'll see the result. thanks again.
@RachelDeBarrosLive
@RachelDeBarrosLive Жыл бұрын
Let me know how you make out!
@charlesmiller6132
@charlesmiller6132 9 ай бұрын
You are wonderful. Great teacher and fun to too! ❤❤
@louiepauda6275
@louiepauda6275 Жыл бұрын
Amazing! You're amazing with all that knowledge of configuring the functionality! Rated highest in my class when in college making me pretty much a good for it geick! Really injoy the jargon! Looking bright, brilliant and a natrual at it!
@Frisky0563
@Frisky0563 4 ай бұрын
Hi Rachel, great video I enjoyed your presentation of this topic of millis() thanks
@navinkumar6888
@navinkumar6888 4 ай бұрын
Good teachers inspire and motivate students to reach their full potential. You are worthy and amazing Teachers. You can change lives and anyway you are doing a great Job.❤
@markwerley6965
@markwerley6965 Жыл бұрын
This was very well conceived and presented. A few years ago i built a Halloween Monster in a Box prop, and although I noodled my way through the coding, I would have benefited from this video. Nice work.
@rudyvlog2897
@rudyvlog2897 Жыл бұрын
Wow thanks ma'am looking forward for more interesting tuitorials 🙂
@rinkashime0289
@rinkashime0289 11 ай бұрын
At the end about what you said on the servo library where there are certain pins that will not behave right when you use a servo library. It is new to me and that I have a previous project where I encountered such problem, I wasn't able to determine the problem. Now I know why, thanks Ma'am
@christophe1800
@christophe1800 11 ай бұрын
If i could, i would have given this video more than 1 thumbs up. Very entertaining and instructive. Thanks.
@contentcliques4260
@contentcliques4260 9 ай бұрын
This is seriously a great video. Hit my issue exactly !
@RachelDeBarrosLive
@RachelDeBarrosLive 9 ай бұрын
Awesome
@TheUnofficialMaker
@TheUnofficialMaker Жыл бұрын
Very clear and outstanding job of explaination with examples and code.
@ph21meo
@ph21meo Жыл бұрын
I got my code pulse counting running with other set of code. Thank you❤🎉
@StaleCookies
@StaleCookies 10 ай бұрын
Wow fantastic you are so engaging I learned a lot and at a manageable pace thankyou
@yyusof78
@yyusof78 3 ай бұрын
Woww, im really happy with the explanation, easy to catch up..done subscribe 😊
@watsonbanda7702
@watsonbanda7702 8 ай бұрын
From malawi ,ur brilliant
@carrizzle9586
@carrizzle9586 Жыл бұрын
Great video!!! Very detailed explanation of the Millis function and how to make use of multiple devices at once, kind of. Thanks for sharing.
@mrrgc74
@mrrgc74 10 ай бұрын
I have been looking for something to create a set of boom gates for a model train layout soooo many thanks you have explained everything i needed to know.
@dab3963
@dab3963 9 ай бұрын
Great video, very clear explications I appreciated too much. I wonder how to solve in case of a button with 2 states and debouce problems without use of delay function
@mikey38632
@mikey38632 10 ай бұрын
Thank you for this video, it is most timely. I am planning to use a microcontroller with similar capabilities to drive several LED status lights with various behaviors during various conditions, and this is likely the key to making it all work together properly.
@RachelDeBarrosLive
@RachelDeBarrosLive 10 ай бұрын
Neato! Let me know how you make out!
@davidgierke7582
@davidgierke7582 11 ай бұрын
As a retired high school technology teacher who subsequently became the author of books concerning the internal combustion engine and pioneer flight. I am currently working on a series of books designed to meet the needs of middle grade kids who are interested machines from a hands-on perspective-a severely overlooked topic that is rarely addressed in middle school or high school library books. Book one (completed) is about an 11 year-old who is enthralled by the internal combustion engine and its systems. In book two, our protagonist desperately wants to learn how to code because he knows that modern engines depend upon ECMs (Engine Control Modules). Unfortunately, I wasn't having much success in my "coding research"-until I ran across your channel and watched two of your Ardiuno-assisted lessons. Wonderful-what a talent you are! I was not only impressed by your knowledge of coding, but also your ability to deliver a well-researched lesson plan! Your two "lessons" did more for me than a month's reading of two of the most current books on "coding for kids!" Please continue with these coding-centered lessons. PS-would you consider co-authoring book two?
@speakertoanimals
@speakertoanimals Жыл бұрын
Very Nice! Polling is incredibly useful, simple to code, and effective (as long as the processor works faster than the components.) You did a great presentation. BTW, I think your vid on using hardware interrupts (for the button) is a great way of kicking it up a notch.
@cyberphox1
@cyberphox1 11 ай бұрын
Really nice and engaging video. Subscribed
@danieltugui4364
@danieltugui4364 Жыл бұрын
extremly useful, thank you from italy
@RachelDeBarrosLive
@RachelDeBarrosLive Жыл бұрын
Glad it helped!
@vantondercorne
@vantondercorne 10 ай бұрын
you are the best. Thank you🤗
@shaikeshap
@shaikeshap 4 ай бұрын
Awesome, just awesome.
@skipsmessyworkbench
@skipsmessyworkbench 10 ай бұрын
Again...Excellent lesson!!! I've subscribed to you on both of my channels.
@jamesmoon5632
@jamesmoon5632 8 ай бұрын
Great tutorial
@vermeirmarc2
@vermeirmarc2 Жыл бұрын
Thanks a lot, helps me a lot! Clear explanation and good examples! Best regards, Marc
@J_Creative
@J_Creative Жыл бұрын
Beauty with brain 🎉thank to this clear tutorial hope to have some more tutorials,,😊
@DONCRAGUN
@DONCRAGUN 11 ай бұрын
Hi Rachel. I really like your teaching style. The energy and enthusiasm are infectious. I wish I had had computer science teachers with your skills when I was learning to program 50+ years ago. However, I think the range of values written to your servo are a little bit out of range. If servoIncrement is 5, your code would give values from 185 to -5 inclusive to the servo.write method. Shouldn't you have something more like: servoPos += servoIncrement; if((servoPos > 180) || (servoPos < 0)) { servoIncrement = -servoIncrement; servoPos += 2 * servoIncrement; } servo.write(servoPos); or: if((servoPos + servoIncrement > 180) || (servoPos + servoIncrement < 0)) { servoIncrement = -servoIncrement; } servoPos += servoIncrement; servo.write(servoPos);
@SpectreTTM
@SpectreTTM Жыл бұрын
Loved the pacing of the coding. Too many times people go so fast and don't explain why they code things a certain way. It felt like we were included in the thought process of the code rather than just watching someone type in the code. Stumbled across this video looking for multi tasking on the Arduino for a Halloween prop. Thought it was a coding channel until I looked at your other vids. Pleasantly surprised to see the Halloween / props vids. Thx
@garciawallace7106
@garciawallace7106 10 ай бұрын
Hi Rachel, Thank you for this awesome video, using millis function. I am working on a project display and i need to pause some warning banners when triggered by different sensor readings, but when i used delay function every freeze up and Sensor reading start lagging i didnt like it so had to get rid of the delays but then the banners wont show now. So i think this millis will fix my issue. Tried it before but i tried using it lik a delay() and now after watch you videos i see why it didnt work. Lol So thank you for these great videos it so easy to follow along i learn a lot from your vids.
@mdrafiqul3358
@mdrafiqul3358 Жыл бұрын
Thank you very much good work, prayers and best wishes for everyone
@lidiaermolenko621
@lidiaermolenko621 11 ай бұрын
Please, do not stop, this is best lessons, what i see. What do you thing about FLprog, for education Arduino?
@mikey38632
@mikey38632 10 ай бұрын
At 18:00 I'm thinking you could probably do a ledState = !ledState But having the If statements is good when there are more things to be done based on the If's
@RachelDeBarrosLive
@RachelDeBarrosLive 10 ай бұрын
Great idea! I'll have to try that out.
@SandeepSandhu
@SandeepSandhu 11 ай бұрын
Brilliantly explained….👌🖖
@RachelDeBarrosLive
@RachelDeBarrosLive 10 ай бұрын
Thank you 🙂
@hornbachhh
@hornbachhh 4 ай бұрын
Hi Rachel I enjoy your videos and they are very helpful for my hobby. Have you done any videos showing how motors with encoders can be coded for Arduino? Say if I want a motor to home at an exact point every time after spinning for a desired amount of times. If you haven’t would you consider doing a video because you are easy to follow. Many thanks and keep up the great work.
@ayganotomasyon1109
@ayganotomasyon1109 Жыл бұрын
Thank you. Very good sample code to understand millis..
@maokai8310
@maokai8310 9 ай бұрын
thank you this was clear
@DBB-KE5DUO
@DBB-KE5DUO Жыл бұрын
This is just like a Perl program i wrote many moons ago! i measured from the computer epoch to several "triggers" including one that sent an error email if the program seemed to be running away (but continued until another time frame passed by) ... 😎😎😎😎😎😎😎😎😎😎
@RachelDeBarrosLive
@RachelDeBarrosLive Жыл бұрын
Neat! 👍
@johnsun2416
@johnsun2416 11 ай бұрын
Is there a way to use millis to create flashing light with independent off time on on time adjustments?
@sajiniwasana7869
@sajiniwasana7869 Жыл бұрын
You are an amazing teacher 😍😍😍 thank you very much ❤
@KeffelewAssefa
@KeffelewAssefa Жыл бұрын
Thank you, great tutorial.
@wisco58
@wisco58 11 ай бұрын
super super interesting video's. Just one question. Do you have a video where you use a servo motor controlled by a joystick?
@rujhannalsor3638
@rujhannalsor3638 5 ай бұрын
Thanks so much teacher
@mixme8655
@mixme8655 Жыл бұрын
New subscriber I enjoy watching your videos thank you ❤ with sense of humor I learned a lot from you as beginner
@SusanAmberBruce
@SusanAmberBruce 11 ай бұрын
Brilliant tutorial thanks
@310765
@310765 9 ай бұрын
Hi Racheal, how would I fade down the blue LED
@nara49veera12
@nara49veera12 Жыл бұрын
Excellent delivery of key concepts. Awsum. It will help me more if you use larger fonts when you explain the code, Thanks in advance.
@stefannilsson7692
@stefannilsson7692 9 ай бұрын
Hi I've been trying to get a servo go to 180 when you seter press the button in position on don't know what I'm doing wrong have tried a little bit of everything but millis might work what do you think about it
@fooballers7883
@fooballers7883 Ай бұрын
Thank you for a very useful introduction to multi tasking....
@arliewinters2776
@arliewinters2776 9 ай бұрын
I like your teaching... I come from C#, does Arduino have a "backgroundworker" function ? Where you can have two threads working at the same time ?
@GreatPlainsChaser
@GreatPlainsChaser 9 ай бұрын
So glad I found this channel... Have you done a stepper motor video yet?
@grk608
@grk608 10 ай бұрын
Hi Rachel, So what if I wanted to use millis to blink the LED only once? I have several instances of millis I want to use but I want each one to do it at different times and only one time each. The delay function won't work because it blocks the other code from running that has to keep running. Thanks.
@mixme8655
@mixme8655 Жыл бұрын
Lively presented love it ❤
How to Control a 12V Motor with Arduino: Easy Wiring & Code Examples
44:13
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
It’s all not real
00:15
V.A. show / Магика
Рет қаралды 20 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
How to use millis() function to multitask in arduino code.
10:34
Mario's Ideas
Рет қаралды 63 М.
How to Use Arduino Interrupts The Easy Way
33:28
Rachel De Barros
Рет қаралды 95 М.
Doing multiple timed things with Arduino: Unleash the millis()!
12:25
Programming Electronics Academy
Рет қаралды 126 М.
I tried the Cheapest Arduino Alternative (that Nobody heard of)
13:31
How to do multiple tasks in Arduino | Beginners | millis() function
10:23
Introduction to Arduino: UNO R4 Minima
17:45
ExplainingComputers
Рет қаралды 69 М.
Wiring a Wiper Motor for Your Motorized Props!
26:54
Rachel De Barros
Рет қаралды 90 М.
EP7 - How to Program Arduino - New Menu with Class and I2C LCD
1:41:21
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН