Multitasking with Arduino | Relay Timer Controller

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ค. 2020
  • In this video, I demonstrate a relay timer controller. It is implementing millis function to achieve multitasking.
    In here the following task are separate task to demonstrate multitasking:
    1. The ON state of the relay (simulated through the LED)
    2. Navigating the LCD menu by using buttons
    For more details, (circuit diagram and source code) visit my blog post:
    techtotinker.com/2020/07/22/m...
    If you find this video as helpful, please give me thumbs up and Share this to your friends.
    Leave your comments in the comment box.
    Please do not forget to Subscribe.
    Thank you and have a good day.
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    great work sir

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

    Nice project

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

    Link error.

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

    Using your example, could you have one input to initiate executing all three after setting the individual timers

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

    Best Example

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

      Wow. Thanks for the appreciation.

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

    Thanks. really helpful. More Please add timer in milliseconds

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

      Hi @Dean Lee, I believe its already in milliseconds. millis() function returns a value in milliseconds. Thanks, cheers.

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

      @@TechToTinker Thanks. Cool

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

    Hey. Your video was very useful. But i have a problem that everytime i reboot the controller, the set value is erased. Can you make a video with saving the values in eeprom?

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

    Please More on this topic. All about time Scheduler

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

      Hi @Dean Lee, we will see in the future. Thank you for your suggestion.

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

    Respcted Sir,
    Thanks for video,
    Sir, yet i didnot found code for the, if during process the displayed value (analog signal) start increasing toward maximum value, at one point of time it will become constant(now not increasing), one pin of microcontroller will 'LOW' (initially high)
    Sir can you help.

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

    muito bom

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

    Can you provide a similar program but made the port timings in loop; first port (led) on for X-amount of time, second port (led) on for X-amount of time and so on. I would need such a program to control up to five relays in sequence one after another, then stop. Then execute with trigger pulse.

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

      You may email me at tech.to.tinker@gmail.com if you still need this request. Cheers.

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

      I also want to ask this same question?

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

    I measure weight with arduino and then print with thermal printer. currently measuring and printing. but what I want is to have the button active after measuring. ie multitasking. can you help me
    void loop()
    {
    do
    {
    currentTimeAnimation=millis();
    if (currentTimeAnimation-previousTimeAnimation>=animationInterval)
    {
    //350ms geçti
    lc.clearDisplay(0);
    lc.clearDisplay(1);
    lc.clearDisplay(2);
    lc.clearDisplay(3);
    lc.clearDisplay(4);
    lc.clearDisplay(5);
    setAnimationPoint(animationCounter);
    animationCounter++;
    if (animationCounter==6)
    {
    animationCounter=0;
    }
    previousTimeAnimation=currentTimeAnimation;

    }
    } while(digitalRead(7)==HIGH);



    measureHeight();
    measureWeight();
    delay(1000);
    measureHeight();
    measureWeight();
    delay(1000);
    measureHeight();
    measureWeight();
    delay(1000);
    wdt_reset();

    turnOffDisplays();
    delay(500);

    displayWeight();
    digitalWrite(13, HIGH);
    delay(500);
    turnOffDisplays();
    digitalWrite(13, LOW);
    delay(500);

    displayWeight();
    digitalWrite(13, HIGH);
    delay(500);
    turnOffDisplays();
    digitalWrite(13, LOW);
    delay(500);

    displayWeight();
    digitalWrite(13, HIGH);
    delay(500);
    digitalWrite(13, LOW);
    delay(500);
    digitalWrite(13, HIGH);
    delay(1000);
    digitalWrite(13, LOW);
    wdt_reset();
    previousTimeButton=millis();
    do
    {
    currentTimeButton=millis();
    if (currentTimeButton-previousTimeButton>=buttonInterval)
    {

    yazdirSureBitti=true;
    break;
    }
    } while(digitalRead(yazdirPin)==HIGH);

    //Buton basma için zaman geçti
    if (yazdirSureBitti==false)
    {
    print();
    }
    yazdirSureBitti=false; //

    }

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

    How place pin SDA, SCL if using i2c modul..?

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

      @ulya panwa, what do you mean?

  • @WaqarAhmed-xr6zd
    @WaqarAhmed-xr6zd 3 ปีที่แล้ว

    Nice 👍 job but make menu more simple to operate

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

      Thank you @Nabeel Ahmed, we will see. Cheers

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

    How you use RTOS and State Machine

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

      Hi Raam, in this video I use a millis() function which is a easier to use. RTOS and State Machine could be, could be may next tutorial.
      By the way, thank you for visiting TechToTinker channel :)

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

      @@TechToTinker Okay Thank you, Please Explain in Next Tutorial Deeply How it is Working by RTOS...

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

    Dear sir can u make in all funtion with one task in one time, can u make for me

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

      @Viral In World, what do you want to achieve?

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

    Can i set it up to2 hrs?

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

      Hi @B&A FX ANALYSIS, yes you can. Just set the interval to 7,200,000. That's 2 hours x 60 minutes x 60 seconds x 1000 milliseconds.

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

    its continue cycle code?

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

    Hi. can I see the wiring diagram?