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

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ธ.ค. 2024

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

  • @Bravo_Ventures_LLC
    @Bravo_Ventures_LLC 22 วันที่ผ่านมา

    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 4 หลายเดือนก่อน +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 9 หลายเดือนก่อน +1

    Great lesson thank you for your time

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

      Thanks for watching 😊
      Pls share..

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

    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?

  • @sheekosheko
    @sheekosheko 8 หลายเดือนก่อน +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  8 หลายเดือนก่อน

      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 9 หลายเดือนก่อน

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

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

      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

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

    How to decode ir remote using r4 minima

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

    Are there solutions to your challenge activities on the web?

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

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

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

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

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

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

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

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

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

    Will these work on R3 also?

    • @joedgoh
      @joedgoh  6 หลายเดือนก่อน +1

      Yes, codes here are compatible with R3

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

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

    • @joedgoh
      @joedgoh  6 หลายเดือนก่อน +1

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

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

      @@joedgoh I told all my students.👍

    • @joedgoh
      @joedgoh  6 หลายเดือนก่อน +1

      Thank you so much :)

  • @VictorPang-iq4yh
    @VictorPang-iq4yh 8 หลายเดือนก่อน

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

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

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

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

    when will we see your next lesson 13

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

      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! :)

  • @HobbyHomeWorkshop
    @HobbyHomeWorkshop 10 วันที่ผ่านมา

    We definitely need a state machine.🤓

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

    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  6 หลายเดือนก่อน +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.

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

    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.

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

    Ciao perché non ci sono più video?

    • @joedgoh
      @joedgoh  8 หลายเดือนก่อน +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.

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

    Excellent!

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

      Thank you!

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

    Excuse me sir. I would like to contact you

  • @Cheene-n2h
    @Cheene-n2h 2 หลายเดือนก่อน

    Sir magkano po ang sunfounder na kit?

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

      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

  • @NoName-ut9wd
    @NoName-ut9wd 3 หลายเดือนก่อน

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

    • @Cheene-n2h
      @Cheene-n2h 2 หลายเดือนก่อน

      FF.

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

    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  6 หลายเดือนก่อน +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! 😊