-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
time stop at 15sec #8
Comments
The answer is among the other comments. It's a line of code you need to fix. Sent from my iPhone
|
It works right!! |
Hmmm... I've just the same problem. My timer stops at 15 seconds, no matter whether it is 2:15, 5:15 or 0:15. Moreover, if I set the timer to, say, 0:14, it doesn't even start to count down. I don't quite get though what the solution is... what other comment are you refering to? Here's my code, by the way: #include "CountUpDownTimer.h" CountUpDownTimer T(DOWN); void setup() { lcd.begin(16, 2); } void loop() { T.Timer(); lcd.setCursor(0, 0); } Rather straightforward, I'd have thought... But probably I'm just too stupid :) |
The answer is in the other comments Sent from my iPhone
|
Am I blind? Which other comments? I only see five including the one I'm writing right now... sorry... |
Sorry about that. I found the issue and I will post the fix soon. The problem was a missing operator ( ! ) in the TimeCheck function. All you need to do is change _type to !_type. Save it and it should work. Sent from my iPhone
|
Wow, thank you! It works. And, as fofito13 has already said, awesome library. |
Thank you. I fixed the bug in the library and re-uploaded it Sent from my iPhone
|
Hi |
What happens if you are doing something (or decide to put in a delay) and go past the time you set for? Then == doesn't work. Sent from my iPhone
|
Hi Anyway I like your library, It makes my life easier. :) THANK YOU if (T.TimeCheck(0, 0, 27)) { |
Do a print of TimeCheck at those times and see if you always see true. I'm betting if you invert the logic i.e. You should see the code working. Or if you want you can create a new method for yourself and I will add it in later to the library. I would call it "ExactTimeCheck(...)" Sent from my iPhone
|
Thank you for your fast respons and your time. Currently working on some project and it is close to end. I like the ExactTimeCheck(...), but I will give it a time till I finished it, to be sure that the right way. |
i use this script in arduino nano:
`#include<CountUpDownTimer.h>
CountUpDownTimer T(DOWN);
void setup()
{
Serial.begin(9600);
//pinMode(6, INPUT_PULLUP);
pinMode(botonPin1, INPUT);
T.SetTimer(0,0,20);
T.StartTimer();
}
void loop()
{
T.Timer(); // run the timer
//Serial.println("run \r\n");
if (T.TimeHasChanged() ) // this prevents the time from being constantly shown.
{
Serial.print(T.ShowHours());
Serial.print(":");
Serial.print(T.ShowMinutes());
Serial.print(":");
Serial.println(T.ShowSeconds());
}
}`
at 15 seconds the counter stop.
please help me!!
The text was updated successfully, but these errors were encountered: