Arduino - Multitask Your Programs - Example with 2 LEDs Blinking at Different Rates

Поделиться
HTML-код
  • Опубликовано: 25 окт 2024

Комментарии • 24

  • @luccubsol
    @luccubsol 2 года назад

    This overly underrated, adore it. TYSM♥

  • @pufarinu
    @pufarinu 2 года назад +1

    Great video. Thanks mate!

  • @LowerDeckProps
    @LowerDeckProps 3 года назад +1

    Excellent video. Is is possible to download the sketch you created in the video? Thanks.

  • @neon8647
    @neon8647 2 года назад +1

    Hello Sir!
    Very good Video. I tried by myself and it works very fine. But now I have a question for a modification. I want to bulid Helicopter-Anti-Collison lights. So I need the LEDs flashing. Now the LED is 1 second on, and 1 second off. For the Heli-Light I would need for example 25 milliseconds on and 1 second off. How can I realize that? Thank you very much!

  • @Alsifnrbdvehrj
    @Alsifnrbdvehrj 2 года назад

    This helped a bunch! Subscribed and thank you😁

  • @pietrobassoli
    @pietrobassoli Год назад

    veramente un buon lavoro ma dove possso copiare il codice senza scriverlo a mano?....Nel caso volessi fare su entrambe le uscite 4 lampeggi poi un t off regolabile mi serve per ogni ramo un ciclo di conteggio poi un delay con uscita off ? Hai qualche esempio di codice per contare i lampeggi per poi fare un jump a un ciclo for-next? Grazie per la tua gentilezza . Piero

  • @rommerts
    @rommerts 3 года назад

    Perfect tutorial. Thank you! This is a nice one to place on your website.

  • @BonyaBoy
    @BonyaBoy 2 года назад

    is it possible to blink the lights at two different random rates? I'm trying to simulate the "flicker" of a tv on the walls of a model structure on an HO Model railroad. This is soooo close to what I need! I just need randomness on both legs now! Doable??

  • @cliffordnealon
    @cliffordnealon 2 года назад

    Thanks, this is great stuff.

  • @nurizzah1610
    @nurizzah1610 Год назад

    if i don't write byte just ledstate = low, is it still correct ?

  • @davi4828
    @davi4828 3 года назад

    Thank u, you helped me a lot. Keep up the excellent work! :D

  • @magmagth4346
    @magmagth4346 2 года назад

    Many thanks
    I have a text file stored in sd memory as follows, it consists of three columns
    0'10,0
    10,0,0
    0,0,10
    0,0,0
    10,0,0
    ..
    I have three LEDs connected to three terminals (pins) of the Arduino, for example 7,8,9
    How do I get a code that enables the Arduino UNO to read the text file and convert each number 10 to 5 volts on one of the three pins
    Thus, it will light three LEDs sequentially according to the data stored in the SD card memory. Thank you very much

  • @japheth6659
    @japheth6659 2 года назад

    What if I want to stop both leds up to 1 minute?

  • @louisfain
    @louisfain 2 года назад

    How accurate would this program be? shouldn't it totally be dependent on how fast the Arduino is able to run through the loop? so say if it loops through every 20 miliseconds (just a random number i made up), you would go from 1280 to 1300 milisec in one iteration, so the led would instead be blinking at 1300 milisec.

    • @RoboticsBackEnd
      @RoboticsBackEnd  Год назад

      Yes you're correct in your understanding. Now, the Arduino goes very fast (each instructions is just a few microseconds), so one iteration of the void loop should take way less than a millisecond (if you don't have delay() and no huge loop inside). So, the program can be quite accurate, up to a few microseconds.

    • @louisfain
      @louisfain Год назад

      @@RoboticsBackEnd Thank you for your answer!

  • @jawaharnehru8531
    @jawaharnehru8531 Год назад

    In this now how to set different high and low delay for a single led

  • @elieeid8865
    @elieeid8865 Год назад

    How to make LED1 blinks 5 times, and the LED2 blinks 10 times when the LED2 stops blinking

    • @RoboticsBackEnd
      @RoboticsBackEnd  Год назад +1

      You could add 2 variables: use a counter for LED1, and a counter for LED2

    • @elieeid8865
      @elieeid8865 Год назад

      @@RoboticsBackEnd I'm not so pro. How to add a counter on it please. And thank you for replying

  • @neuro_corgi
    @neuro_corgi 2 года назад +1

    Actually, the program will stop working after about 50 days because passed time will overflow unsigned int and will become zero again

    • @RoboticsBackEnd
      @RoboticsBackEnd  2 года назад +3

      Yes, the time with millis() is going to overflow after about 50 days, but the way the code is written, it's not going to be a problem - so it's going to work indefinitely. Check out the explanation here --> ruclips.net/video/P6R_ofWQfuw/видео.html

    • @Henry-sv3wv
      @Henry-sv3wv Год назад

      overflow doesn't matter if you write it right

  • @Victurf
    @Victurf Год назад

    Beaucoup trop compliqué!