bremme / arduino-tm1637

Arduino library for using a 4 digit seven segment display with TM1636 or TM1637 driver IC
GNU General Public License v2.0
164 stars 62 forks source link

bombTimer not accepting 0 hours #5

Closed fooons closed 8 years ago

fooons commented 8 years ago

Hello bremme.

in the countdown bombtimer if I want to setup my code for only 30 seconds, it can't be possible and the counter never passes through the zero. For example, if I put 1 minutes and 5 seconds, when the seconds counter arrives to zero does not start in the 59 remaining seconds for the last minute.

Sequence example 01:05 - 01:04 - 01:03 - 01:02 - 01:01 - 01:00 - 00:00 (it should be 00:59)

Thanks in advance.

bremme commented 8 years ago

Been quite busy lately, sorry for the late response. I Will look into this soon and I will let you know when it's fixed.

fooons commented 8 years ago

No problem, I understand you are a busy man. Thanks for your efforts

bremme commented 8 years ago

I just had a look and solved this issue. If you want you can test the latest version to see if it works for you as well. I tested the countdown using the sketch below:

// #include "SevenSegmentTM1637.h"
// #include "SevenSegmentExtended.h"
#include "SevenSegmentFun.h"

const byte PIN_CLK = 4;   // define CLK pin (any digital pin)
const byte PIN_DIO = 5;   // define DIO pin (any digital pin)
SevenSegmentFun    display(PIN_CLK, PIN_DIO);

// run setup code
void setup() {
  Serial.begin(9600);         // initializes the Serial connection @ 9600 baud
  display.begin();            // initializes the display
  display.setBacklight(100);  // set the brightness to 100 %
  delay(1000);                // wait 1000 ms
};

// run loop (forever)
void loop() {
  byte hours = 1; byte min = 16; unsigned int speed = 60;
  display.bombTimer(hours, min, speed);
  delay(1000);;
};
fooons commented 8 years ago

It works perfect!

Now I will try to Stop,Pause and Resume the timer and the implementation of a live speed change of the timing by pushing buttons or a pot value.

Thanks and best regards.