Arduino UNO R4 Lesson12 - millis Function | Handling Multiple Tasks | Non-Blocking Code

Поділитися
Вставка
  • Опубліковано 1 лют 2025

КОМЕНТАРІ • 44

  • @Bravo_Ventures_LLC
    @Bravo_Ventures_LLC 2 місяці тому

    Strange and amazing. I found this the day I failed at adding millis function to second task. After days if researching how to multi task without delay I found only videos with millis function being added to one task. Today, i tried to add to second task and failed. Now this video pops up. They got the algorithm down to even the process of users learning a system

  • @philgirard3956
    @philgirard3956 5 місяців тому +1

    Hello, thank you for this beautiful video. I'm a novice and I'm stuck doing the exercise. in the example the on and off time of the LED is the same, if I code the same principle for another LED, the first LED also lights up even though it should not. the off time of the first LED must be longer than the on time so that the second LED can light up in turn, and I don't know which line of code to intervene. where is the answer to the solution and sorry for my broken english. thank you

  • @alistaircook1997
    @alistaircook1997 11 місяців тому +1

    Great lesson thank you for your time

    • @joedgoh
      @joedgoh  11 місяців тому

      Thanks for watching 😊
      Pls share..

  • @VictorPang-iq4yh
    @VictorPang-iq4yh 9 місяців тому

    Hi Joed, can’t wait to learn from your next lesson.

    • @joedgoh
      @joedgoh  9 місяців тому

      Thank you for waiting. Lesson 13 is now out! Please check 😊

  • @santhoshr53
    @santhoshr53 Місяць тому

    Sir i want to measure relay operation time from No to Nc in milli second it's possible and how plz guide me

  • @richardphillips1891
    @richardphillips1891 6 місяців тому

    I am still confused on how the multiple lights would be configured so only one comes on at a time. You left a clue about the pos=90 to display the green LED but I'm unclear on where that logic would be. Is there "challenge code" I can lookup to see how to handle this?

  • @santhoshr53
    @santhoshr53 Місяць тому

    how to calculate operating time of electro mechanical relay in Arduino

  • @sheekosheko
    @sheekosheko 9 місяців тому +1

    I have a question and its. How can use single Arduino. Into multiple sensors like. Developing home automation systems using RFiD,Light,Fans, and temp. Using 1 Arduino and mobile app

    • @joedgoh
      @joedgoh  9 місяців тому

      Hi, your question is broad and cannot be answered directly here with a simple chat. It is a combination of concepts that you will learn in the future if you continue watching this series. Thank you

  • @KingKong-kk4bs
    @KingKong-kk4bs 10 місяців тому

    Hi sir, how do we use push button as trigger/ toggle the movement of servo with millis since usually I used delay?

    • @joedgoh
      @joedgoh  10 місяців тому

      The same way as I have discussed in this lesson. How do you use it using delay by the way? Let me see your code first.. thanks

  • @HobbyHomeWorkshop
    @HobbyHomeWorkshop Місяць тому

    We definitely need a state machine.🤓

  • @richardsardini5585
    @richardsardini5585 4 місяці тому

    Seems like a block of code is put out there, then everyone does it exactly the same. I would use a different approach.
    Simply use one variable such as Blink
    Blink=millis()+Millisecond interval you desire. millis()+1000=every second.
    then just check if millis()>Blink IF yes then check if pin is high or low and take appropriate action with your IF ELSE, if high set low and if low set it high.
    Then just put Blink=millis()+1000 just before exiting your if statement when you checked if millis() was > Blink.

  • @iMjoooooo
    @iMjoooooo 11 місяців тому

    Hi prof! Can you do a video tutorial for PUG xml and ruby on rails?

  • @samnus
    @samnus 7 місяців тому

    i have a challenge also to you. Blink a LED every 1 second continuously using a simple sketch with 3 lines of code using 2 functions only. Materials needed are Arduino uno, 220 ohms resistor and LED.

    • @joedgoh
      @joedgoh  7 місяців тому +1

      Your instruction is incomplete. Does it have to be custom function or a built-in function like a simple digitalWrtie and digitalRead will do?. Is it required to use millis because you posted it on this topic? By the way, using 220 ohms resistor on UNO R4's gpio when connecting to an LED is not advisable, as its max current is only 8mA.
      I might not be able to answer your challenge because I don't know anything. I just teach and share what I know. I don't challenge others just to prove that i am better than them, because I am not. Please teach me and the others how it is done. Thank you.

  • @RobertBeesley
    @RobertBeesley 10 місяців тому

    Are there solutions to your challenge activities on the web?

    • @joedgoh
      @joedgoh  9 місяців тому

      Hi, I'm sorry but I don't post the Challenge Activity on the web. Thank you for your support 😊

  • @PhG1961
    @PhG1961 10 місяців тому

    Excellent!

    • @joedgoh
      @joedgoh  10 місяців тому

      Thank you!

  • @gyrurur
    @gyrurur 10 місяців тому

    How to decode ir remote using r4 minima

  • @vijaysulakhe5605
    @vijaysulakhe5605 8 місяців тому

    Will these work on R3 also?

    • @joedgoh
      @joedgoh  8 місяців тому +1

      Yes, codes here are compatible with R3

    • @vijaysulakhe5605
      @vijaysulakhe5605 8 місяців тому

      @@joedgoh Thanks...for making such interesting educational videos.

    • @joedgoh
      @joedgoh  8 місяців тому +1

      You are welcome 😊
      Glad to be of help. Pls share.

    • @vijaysulakhe5605
      @vijaysulakhe5605 8 місяців тому

      @@joedgoh I told all my students.👍

    • @joedgoh
      @joedgoh  7 місяців тому +1

      Thank you so much :)

  • @alistaircook1997
    @alistaircook1997 10 місяців тому

    when will we see your next lesson 13

    • @joedgoh
      @joedgoh  10 місяців тому

      Hi Alistair, I'm sorry for not being able to produce lesson 13 this week. I've been out of the country since last week (Japan 😃 ). I will start lesson 13 by next week. Thanks for watching! :)

  • @vijaysulakhe5605
    @vijaysulakhe5605 8 місяців тому

    My request... kindly make such videos for Pi Pico W....it has lot of resources... and students ( and we also) are very much cost conscious...I can have 3 Pi Pico at cost of one R4...£ $ € Rs matter...many thanks.

    • @joedgoh
      @joedgoh  7 місяців тому +1

      Hi. Thanks for your suggestion and I understand your concerns. However, as of now, I do not have any sponsor for R pi pico W. If it wasn't for SunFounder who provided me with the Arduino kit and sponsoring this series, I would not be producing videos anymore because it is hard and time consuming. I only do it on a part-time basis. Producing online lessons is also costly. When I have a spare time and/or sponsorships, I'll produce the R pi pico W series. Thank you for understanding! 😊

  • @NoName-ut9wd
    @NoName-ut9wd 4 місяці тому

    How we can reset millis(), after 50 days it will be overflow !!!

  • @chitobalazo
    @chitobalazo 8 місяців тому

    Hi Joed,
    I installed avr boards 1.0.5 as per your video. However it’s not finding .

    • @joedgoh
      @joedgoh  8 місяців тому

      You have to install it. github.com/PaulStoffregen/PWMServo
      Please see my previous lesson

  • @michelealbanese4438
    @michelealbanese4438 10 місяців тому

    Ciao perché non ci sono più video?

    • @joedgoh
      @joedgoh  10 місяців тому +1

      Hi, I will upload lesson 13 soon. I had a project for a month and I was not able to produce a video. Thank you for waiting.

  • @Cheene-n2h
    @Cheene-n2h 3 місяці тому

    Sir magkano po ang sunfounder na kit?

    • @joedgoh
      @joedgoh  3 місяці тому

      Depende sa model/package. Eto yung gamit ko sa series na to. Pls check.
      SunFounder Ultimate Sensor Kit with Original Arduino Uno R4 Minima
      www.sunfounder.com/products/sunfounder-ultimate-sensor-kit-with-original-arduino-uno-r4-minima?ref=hmqmlw0e

  • @sheekosheko
    @sheekosheko 9 місяців тому

    Excuse me sir. I would like to contact you