4-Digit Countdown Timer (in minutes and seconds)

Поделиться
HTML-код
  • Опубликовано: 4 июл 2024
  • In this video, I'll demonstrate a slight modification to my previous Arduino TM1637 4-digit LED display code (from this video: • LED Displays ) so that, instead of just counting down integer values from 5000 - 0, it shows a timer counting down from one hour, displaying the value in mm:ss format.
    I'm using an Arduino Nano and a TM1637 4-digit 7-segment display. The Arduino code is available on my Patreon page here: / playfultech
  • НаукаНаука

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

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

    Thank You so much ! Best gift for Christmas

  • @therkellorenzen804
    @therkellorenzen804 5 лет назад +1

    At 8:22 You say if you want something to happen at the end of the countdown you can place it in the loop function but the loop function in your video is outside the frame so where should it be placed? xD I have tried a few options but it never plays at the end, it just resets.

  • @UnveiledRacer48
    @UnveiledRacer48 6 лет назад

    Great video mate, I was looking for something like this. Also if use that code in a "bomb type puzzle case" how would you change the code to subtract 5 mins from the clock for a "wrong" input (not completing understanding Arduino code yet). Any help would be great. Thanks.

    • @PlayfulTechnology
      @PlayfulTechnology  6 лет назад

      So, currently there's a line of code that looks like "timeRemaining = timeLimit - millis()". If you wanted to adapt that to include subtractions, you'd change it to something like "timeRemaining = timeLimit - millis() - penalties" instead.
      "penalites" would be an unsigned long variable, initialised at 0. Every time the player made a wrong input, you could add, say, a minute penalty by saying "if(playerMadeWrongInput) { penalties += 60000; }"

  • @nurulnasrah9167
    @nurulnasrah9167 5 лет назад +2

    thank you good sir. you remind me that unsigned long exist :D so i've been trying to make a timer with 8 hours but fail since i declare it as int >< but watching you inspire me hahaha thank you really :)

  • @nilavazhagan3659
    @nilavazhagan3659 5 лет назад

    how to blink the colon in 1sec on/off ,consider digital clock

  • @davidmora2105
    @davidmora2105 4 года назад +1

    Hi Sr. nice video and well explained, can you add to the timer a 4x4 Keypad to choose the time that I want? and how to do it? I study electronic 20 year ago, so I just started with Arduino, but has been so hard to understand things, I'm not. programming person, so can you help me with that?

  • @hannaanjelicaong9719
    @hannaanjelicaong9719 5 лет назад

    Is the code possible to be used on a 4 digit led strip made clock/timer?

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

    Nice Video!
    Can i buy a timer like this, which is working with a battery and a button? I just need a countdown going down from 15 minutes each time the button is pressed.

    • @TheFakeyCakeMaker
      @TheFakeyCakeMaker 6 месяцев назад +1

      Forget asking anything here. I've been looking for something similar, I wanted to build it and contacted this guy asking him to show a simplified version of this but to be honest he was bit of a wanker so don't expect him to be helpful. You're probably best of getting a digital timer that you can set and goes back to 15:00 when done. Amazon like most things.

    • @jingiskhan8372
      @jingiskhan8372 6 месяцев назад

      @@TheFakeyCakeMaker Thanks for the help

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

    Is the wiring and code somewhere?

  • @carlosc.2173
    @carlosc.2173 5 лет назад

    Just Brilliant...... How do I make a beeper sound when the time is over? some help

    • @zitwaar5469
      @zitwaar5469 4 года назад

      buy a 5V buzzer and give it 5V when the timer ends for a second or something.

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

    Is it possible to add a tick to this program? The only ones that I have seen use a delay.

  • @eat-myshorts
    @eat-myshorts 3 года назад +1

    what the final code?

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

    How can I start stop and reset it from a node red dashboard

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

    COULD YOU YOUR CODE PLISSSSSS, I CANT FIND YOUR CODE

  • @gangadhars1353
    @gangadhars1353 4 года назад

    Hello Sir.. I am new to Arduino, I am planning to do project which will glow the light when the timer reaches 0 and I want this to be done for one your clock which is 31536000 seconds to 0 seconds.. need your input.

  • @sebaspower9142
    @sebaspower9142 5 лет назад

    Hi! How can i stop the counter when it is in zero? I try and i cant do it. Thank you.

    • @huldahl123
      @huldahl123 5 лет назад

      I have the same problem. When the counter gets to zero it starts at 2:47 and counting down. Then at zero it starts at one hour again. Does anyone know how to stop at zero? And also how to stop the counting if something happens. (Read switch or something)

    • @scjewell1961
      @scjewell1961 4 года назад +2

      The unsigned long variable timeRemaining has to be long. An unsigned long never becomes negative and timeRemaining always remains positive, meaning you can't break out of the countdown loop.

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

    Hi there!
    Thank you for the video and the explanation!
    Some why, my separator is ":" not showing

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

    the code is not hter in the link also

  • @scjewell1961
    @scjewell1961 4 года назад +2

    The unsigned long variable timeRemaining has to be long. An unsigned long never becomes negative and timeRemaining always remains positive, meaning you can't break out of the countdown loop. This is the answer to the questions below as to how to stop the time.

  • @NoName-sw5ye
    @NoName-sw5ye 3 года назад

    anyone can tell me what "_time_" is?

  • @KennethGomad
    @KennethGomad 6 лет назад +1

    How do you stop the time?

  • @adamkiidumae7647
    @adamkiidumae7647 Год назад +2

    Nope, the original countdown works, but the adjustments in code for the minute/sec countdown produces no display, although the code did compile - same hardware setup for the 5000 second countrdown

  • @kingbernabe734
    @kingbernabe734 3 года назад +3

    (SEMICOLON DISPLAY ISSUE )
    try '0b01000000' instead of '0x80>>3'

    • @MinePark.
      @MinePark. Год назад

      Thank you very much!