Arduino millis() function: 5+ things to consider

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 มิ.ย. 2024
  • 🤩 FREE Arduino Crash Course 👇👇
    bit.ly/get_Arduino_skills
    **If you like this, I think you'll like the premium Arduino training we offer. Check it out here** bit.ly/3nSBPUs
    We designed this circuit board for beginners!
    Kit-On-A-Shield: amzn.to/3lfWClU
    SHOP OUR FAVORITE STUFF! (affiliate links)
    ---------------------------------------------------
    Get your Free Trial of Altium PCB design Software
    www.altium.com/yt/programming...
    We use Rev Captions for our subtitles
    bit.ly/39trLeB
    Arduino UNO R3:
    Amazon: amzn.to/37eP4ra
    Newegg: bit.ly/3fahas8
    Budget Arduino Kits:
    Amazon:amzn.to/3C0VqsH
    Newegg:bit.ly/3j4tISX
    Multimeter Options:
    Amazon: amzn.to/3rRo3E0
    Newegg: bit.ly/3rJoekA
    Helping Hands:
    Amazon: amzn.to/3C8IYXZ
    Newegg: bit.ly/3fb03X1
    Soldering Stations:
    Amazon: amzn.to/2VawmP4
    Newegg: bit.ly/3BZ6oio
    AFFILIATES & REFERRALS
    ---------------------------------------------------
    ►Audible Plus Free trial: amzn.to/3j5IGrV
    ►Join Honey- Save Money bit.ly/3xmj7rH
    ►Download Glasswire for Free:bit.ly/3iv1fql
    FOLLOW US ELSEWHERE
    ---------------------------------------------------
    Facebook: / programmingelectronics...
    Twitter: / progelecacademy
    Website: www.programmingelectronics.com/

ความคิดเห็น • 99

  • @programmingelectronics
    @programmingelectronics  3 ปีที่แล้ว +3

    ****If you like this, I think you'll like the premium Arduino training we offer. You can check it out here**** bit.ly/3lHyzcB

  • @loganphillips5142
    @loganphillips5142 11 หลายเดือนก่อน +8

    It's been 4 years man I'm still waiting on you to tell me the tensile strength of a rubber band

  • @rishabhsstudio1457
    @rishabhsstudio1457 3 ปีที่แล้ว +8

    6 years ago i learnt the basics of arduino from open source hardware, and now i see you again doing this amazing stuff .
    amazing

  • @0miker0
    @0miker0 5 ปีที่แล้ว +36

    The best video ever explaining millis. Thank you and please keep up the great work.

  • @raymondmichael4987
    @raymondmichael4987 5 ปีที่แล้ว +1

    I could have Subscribed even before completing watching ; but content was great, so I subscribed after watching.
    Keep up the good work.
    Greetings from Tanzania 🇹🇿

  • @AbcDef-hl2ic
    @AbcDef-hl2ic 5 ปีที่แล้ว +2

    So great! Look forward to seen something similar on timer interrupt.

  • @ichbrauchmehrkaffee5785
    @ichbrauchmehrkaffee5785 3 ปีที่แล้ว +6

    One minor point of critique:
    Explanations on absolute programming basics (like: What is a variable, what are datatypes, basics about functions etc.)
    are best explained in a seperate, dedicated video.
    Otherwise, it makes the video feel a bit tedious despite the well structured nature of this video.
    Particularly unpleasant for people with some level of programming experience.
    Other than that, this video was quite helpful.

    • @cristian-bull
      @cristian-bull 2 ปีที่แล้ว

      this is the dedicated video for programming basics.

  • @Audio_Simon
    @Audio_Simon 5 ปีที่แล้ว +1

    Your video lessons are fookin brilliant.

  • @BurnerStudio
    @BurnerStudio 2 ปีที่แล้ว +1

    its just incredible how fast things can happen in programming, every millisecond is important

  • @atharavhedage9770
    @atharavhedage9770 3 ปีที่แล้ว +1

    For a moment i was confused and angry? Why the hell You have only 107k broo...Ur content is soo sooo soo awsm you should me 10 millions

  • @daleball9879
    @daleball9879 3 ปีที่แล้ว +3

    So what’s the tinsel strength of an elastic band?

  • @Andrigam3t
    @Andrigam3t 3 ปีที่แล้ว +2

    Damn these videos are soooo good for beginners. Its a shame it dosn't have more views.

  • @TheUsman75
    @TheUsman75 4 ปีที่แล้ว +2

    Hey! who are you man. Believe me you have some very special, good gifted skills in terms of explaining things. The way you elaborate is simply magnificent. This is a great learning experience and please continue this. Thanks

  • @attalaw36
    @attalaw36 3 ปีที่แล้ว +1

    I never saw a video like your videos great. thank you ...

  • @UndernetSystems
    @UndernetSystems 5 ปีที่แล้ว +3

    This is a very good video and super nice explanation.

  • @o-h-1
    @o-h-1 4 ปีที่แล้ว +3

    This tutorial was incredibly useful! Thanks! I am trying to build a toggle button, like a push button that has the functionality of a switch, and was having trouble figuring out the code and set up. Any help would be appreciated. Thanks!

  • @RadionicaExpress
    @RadionicaExpress 4 ปีที่แล้ว +2

    i was blooown away how its explained in detail, thanks

  • @howtomake3182
    @howtomake3182 3 ปีที่แล้ว +1

    Wow! What a video can explain everything! 👍👌

  • @martinsiolowosoran5242
    @martinsiolowosoran5242 4 ปีที่แล้ว +1

    best for this topic, i have been looking for good tutorial like this, u make me have more interest in Arduino programming

  • @sokundavannchriv3967
    @sokundavannchriv3967 8 หลายเดือนก่อน

    Hi thank for good explaination, I never a regret a penny to buy a lesson from you. Looking forward to learn more from you master.

  • @rgmtb
    @rgmtb 4 ปีที่แล้ว

    Very helpful! Will you be creating more videos soon?

  • @pedrovelazquez138
    @pedrovelazquez138 3 ปีที่แล้ว +1

    Great work!

  • @soroushzarein3246
    @soroushzarein3246 3 ปีที่แล้ว +1

    beautifully described thank you.

  • @AliAhmed-tm1jf
    @AliAhmed-tm1jf 5 ปีที่แล้ว +2

    Very nice. Thank you

  • @attalaw36
    @attalaw36 4 ปีที่แล้ว +1

    it was very help full thank you

  • @UpcycleElectronics
    @UpcycleElectronics 5 ปีที่แล้ว +5

    1:40
    Correction. Most Arduinos use a ceramic resonator. This is not as accurate as a crystal. Generally, a crystal is needed for things like serial communication in order to control the baud rate. The crystal pictured in the time stamp is used for this purpose. It is the crystal for the USB to serial converter. In this case the converter is another AVR microcontroller, an ATmega16U2. The crystal resonator used for the ATmega328 is pictured just below "ITAL" in the Made in Italy text.
    -Jake

    • @programmingelectronics
      @programmingelectronics  5 ปีที่แล้ว +5

      Doht! Thanks Jake - that's much appreciated!
      I wish I could annotate these after upload - I might correct and re-upload...hmmmm.

    • @UpcycleElectronics
      @UpcycleElectronics 5 ปีที่แล้ว +2

      @@programmingelectronics
      It's easy to miss this. I have a mini clone that had a bad resonator.

  • @dokepravin2916
    @dokepravin2916 2 ปีที่แล้ว

    Thanks for sharing.. This helped in our project

  • @jackmini1217
    @jackmini1217 2 ปีที่แล้ว

    best explanation i ever met. thnx

  • @cheraitramzi8114
    @cheraitramzi8114 5 ปีที่แล้ว +1

    Love ya man!

  • @cyberphox1
    @cyberphox1 ปีที่แล้ว +1

    Excellently explained

  • @sbarifvlogs335
    @sbarifvlogs335 2 ปีที่แล้ว +1

    My heartiest thanks to you....very helpful video.....

  • @aloneinanearthship4010
    @aloneinanearthship4010 ปีที่แล้ว +1

    Very excellent video, thanks!

  • @ArduBlock
    @ArduBlock 4 ปีที่แล้ว

    Thanks cool video!

  • @SQERS3
    @SQERS3 5 ปีที่แล้ว +3

    woow a very nice video. thanks for effort and very good video made specially the explenation.
    i like your work cant wait to see more, have a nice day.

  • @meghapradosh1145
    @meghapradosh1145 3 ปีที่แล้ว +2

    thankyou very much this really helped me a lot

  • @Sadaat690
    @Sadaat690 5 ปีที่แล้ว +1

    awesome sir...

  • @gioraver
    @gioraver 4 ปีที่แล้ว +1

    gracias por poner mucho esfuerzo en hacer un video muy bueno

  • @mirage3rd
    @mirage3rd ปีที่แล้ว

    Great series about Arduino. Thanks. Question: is the “49 days waiting eating donuts and crab cakes” picture taken in Annapolis, MD?

  • @georgeusroger1
    @georgeusroger1 4 ปีที่แล้ว

    Hello , can i use two functions at same time ? , first function is for running DS18B20 use millis() , seconde fonction while (for running stepper motors and many security sensors , thanks

  • @KW-ei3pi
    @KW-ei3pi 10 หลายเดือนก่อน

    Thank you. This video is the first step in my next project: Calculating the RPM of my stepper motor. The Arduino code that runs my stepper motor driver, turns a Pin connected to the PUL pin of the Driver to HIGH, has a delay of 500, then turns the pin to LOW. This code loops to run the motor at a constant RPM. This video will help. But if you have any suggestions/video recommendations to calculate the RPM, let me know. Thanks!

  • @dirkfrancen2662
    @dirkfrancen2662 ปีที่แล้ว

    Hi, can you do a lesson on the RTC DS3231 displayed on a OLED with the correct to use library's. thx

  • @edgarbonet1
    @edgarbonet1 หลายเดือนก่อน

    Nice video, but there are some inaccuracies:
    1. The timer/counter does not start counting “as soon as power is applied”: it starts counting when initialized by the Arduino core (see the setting of the TCCR0B register in init(), in wiring.c). Admittedly, this happens very shortly after power is applied.
    2. The timer/counter does not overflow after 49 days: it overflows every 1024 µs. The 49.7 day rollover is for the millis() count, which is a different thing.
    3. millis() does not give the running tally stored in the timer/counter: it returns a count of the timer/counter overflows, plus some correction to account for the fact that the overflow happens every 1024 µs instead of every millisecond. The micros() function, unlike millis(), does make use of the running tally kept by the timer/counter.

  • @goldengeckogaming4882
    @goldengeckogaming4882 4 ปีที่แล้ว +1

    Finally, my weeks of frustration are over!

  • @pixies4ever324
    @pixies4ever324 5 หลายเดือนก่อน

    great video.

  • @shagggyman
    @shagggyman 5 ปีที่แล้ว

    HEY! What about the tensile strength of a rubber band???? :)

  • @sdk28
    @sdk28 ปีที่แล้ว

    Thanks for this amazing video
    Challenge q2: The values goes from 0 to 32,767, then from -32,768 to 0 and this cycle repeats.

  • @igrewold
    @igrewold 5 ปีที่แล้ว +1

    cool , thanks. :]

  • @daleball9879
    @daleball9879 3 ปีที่แล้ว

    Did I miss it. I’m watching it again.

  • @frankodonnell9956
    @frankodonnell9956 4 ปีที่แล้ว +1

    Great, BUT please sequence number on your videos properly to track which ones are next

  • @midhunchandran9980
    @midhunchandran9980 3 ปีที่แล้ว +1

    great sir

  • @zx001961
    @zx001961 5 ปีที่แล้ว

    Do you have any services or help on doing program

  • @dmestr
    @dmestr 5 ปีที่แล้ว +2

    the best

  • @summeralbum2741
    @summeralbum2741 5 ปีที่แล้ว

    can you please upload a video on 'color tracking robot using Arduino & android' ?

  • @anujsaini9353
    @anujsaini9353 3 ปีที่แล้ว

    Thank you for explanation, Sir. I want to know, weather millis function can be used for RCWL sensor or not. I tried but nit succeeded. Can U plz guide me. Code as below and I want sensorVal=1 for 5 min
    int =rcwlPin=2;
    int=sensorVal;
    cosnt unsigned long Interval=1000*60%5;
    unsigned long PreviousTime=0;
    void setup(){
    pinMode(rcwlPin,INPUT);
    Serial.begin(9600);
    void setup(){
    sensorVal=digitalWrite(rcwlPin);
    millis()=unsigned long CurrentTime;
    if(sensorVal==1){
    if (CurrentTime-PreviousTime>=Interval){
    sensorval==1
    PreviousTime=CurrentTime;
    }
    }
    else
    { (sensorVal==0)
    }
    Serial.println(sensorVal);
    )
    I upload this sketch, but not getting desired result.
    Kindly resolve it. Thank you

  • @geoffkelland5606
    @geoffkelland5606 2 ปีที่แล้ว +1

    Awesome

  • @SudeepJoshi22
    @SudeepJoshi22 5 ปีที่แล้ว

    how to amplify a input signal in ardunio....or which function is used in the arduino codes??????!!!1

    • @igrewold
      @igrewold 5 ปีที่แล้ว +1

      duckduckgo.com/?q=arduino+amplify+input+signal&ia=web

  • @qusyairitasnim1572
    @qusyairitasnim1572 4 ปีที่แล้ว

    I having a big problem ... I don't know how to reset my timer timeout

  • @TheStevojl3
    @TheStevojl3 2 ปีที่แล้ว +1

    When he uses:
    if (millis() > 3000UL)
    What does the "UL" do?

    • @programmingelectronics
      @programmingelectronics  2 ปีที่แล้ว

      Great question! It means Unsigned Long which is a non-negative big data type

    • @negrilamarius8977
      @negrilamarius8977 11 หลายเดือนก่อน

      @@programmingelectronics, right , the UL or ul converting a number value to unsigned long , but what type is a value when convert a value using u , as example: 3000u what type unsigned is 3000u? integer or long ?

  • @RanaRao_Chandrachur
    @RanaRao_Chandrachur ปีที่แล้ว +1

    and my problem is "I'm making a digital clock [7-segment] using AT89s52 (NO RTC) but the time drifts about 5.6 seconds in every hour!! and this At89s52 microcontroller doesn't have any function like millis() inside AT89s52's IDE(Microvision Keil software), and a book suggests to play with the ppm and fix the error.But, yet the problem is At89s52 is not like Arduino "
    BTW I'm using a 16MHz crystal with this microcontroller and using timer_0 to generate a 25ms delay and using interrupt_1 to count that 40times so that there will be 1 second completed, but that's not the problem I guess.. I just need help.. .😎😎

    • @programmingelectronics
      @programmingelectronics  ปีที่แล้ว +1

      Neat project Chandrachur! I have not worked on an application like that so I can't be of much help...sorry and best of luck!

    • @RanaRao_Chandrachur
      @RanaRao_Chandrachur ปีที่แล้ว

      @@programmingelectronics It's Okay sir, 😃😇 I'm very happy with your so kind response.. .🤓🤓

    • @juliusfucik4011
      @juliusfucik4011 10 หลายเดือนก่อน

      I am a dumb engineer, but since you have quantified the deviations, why not make your seconds 5.6/3600 x frequency shorter?
      It is quick and dirty, but I think given the hardware, there is not much else you can really do. There are too many sources of error at play.

    • @RanaRao_Chandrachur
      @RanaRao_Chandrachur 10 หลายเดือนก่อน

      @@juliusfucik4011 Will try this for sure, ❤️ and u r not a dumb at all, even we can learn a lot from u brother 😊❤️❤️. Thank you, love for u from India ❤️

  • @electroniclover5589
    @electroniclover5589 3 ปีที่แล้ว +1

    what is 3000UL???

    • @juliusfucik4011
      @juliusfucik4011 10 หลายเดือนก่อน

      Unsigned long. It is an explicit cast of the number 3000 into the unsigned long format, so that you compare equal data types.

  • @bjornroesbeke
    @bjornroesbeke 3 ปีที่แล้ว

    1:20 I find it amusing to suddenly see a photo that i made over 14 years ago and put on Wikipedia pop up in this video.
    The circuit wasn't even fully wired up correctly. Now look at me, still trying to learn how to make electronics work properly!

  • @ifell3
    @ifell3 2 ปีที่แล้ว

    and the rubber band?

  • @republicofvegans712
    @republicofvegans712 10 หลายเดือนก่อน

    5:40: isnt the clock going too fast?

  • @quazireshoanyazdi7938
    @quazireshoanyazdi7938 11 หลายเดือนก่อน +1

    I love you

  • @CascadiaFA
    @CascadiaFA 7 หลายเดือนก่อน +1

    you didn’t explain the tensile strength of a rubber band

  • @877cms
    @877cms 5 ปีที่แล้ว +1

    Noice

  • @krakenmusic1623
    @krakenmusic1623 11 หลายเดือนก่อน

    6:00

  • @mickcoomer9714
    @mickcoomer9714 5 ปีที่แล้ว +1

    I suffered watching all that rubbish about electronics so I could see the bit about elastic bands. There was nothing there. I think this was click bait for lovers of elastic bands.
    Keep up the good work on the presentation of technical stuff in a language I can follow.

    • @ipissed
      @ipissed 5 ปีที่แล้ว

      I mentioned the rubber band before the re-upload and thought he must have re-uploaded to add the rubber band part. Nope, still nothing about rubber bands. I think it must be a joke.

  • @boumaizasalah8326
    @boumaizasalah8326 4 ปีที่แล้ว +2

    I'm disappointed where is the tensile strength of a rubber band

  • @onurolce
    @onurolce 5 ปีที่แล้ว +2

    I thought you are going to explain hardware side of Timer/Counter setup in registers. But then you changed your mind and focused on Unsigned datatypes. These lesson looks unfinished lesson. Please make another video about full of this hardware setup...