Giter Club home page Giter Club logo

timer's People

Contributors

brunocalou avatar jmedow avatar phzhitnikov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

timer's Issues

Timers only run 65536 times

in Timer::update repeat_count decrements from -1 until it overflows and hits zero, stopping the counter. The fix would be to add if(repeat_count > 0) repeat_count -= 1

TimerManager question

Hello Bruno,

First I have to thank you for the library, it is helping me a lot to learn C++ basic with Arduino. I have a question regarding management of multiple timers, as I am unable to understand how does it work.

Here is a scenario:

We have 5 timers, like in your multi-timer example and I want to handle them independently (like start/stop/pause) in two groups, like first 3 and last 2. I know how this can be managed individually one by one, but as you have provided TimerManager class I would like to have that “nice” solution. I have tried numbers of options, but, as I am lacking knowledge of a professional, was unable to achieve anything but constant compile errors (mostly “Compilation error: expected primary-expression before '*' token” after trying with i.e. “TimerManager::instance().add(Timer *timer5);”).

Or, maybe approach is to add/remove timers to one single group and then to start/stop/pause them? Whatever it is, I have no idea how to setup a code to manage that…

Can you help with an advice/example for this scenario?

Thank you in advance,
Vidoje.

[Question] Is the code rollover safe?

Hello Bruno,

Congratulations on the great library! I'm using it for a personal home automation project.

Can you tell us if the code was tested for millis() rollover? How does it behaves after 9h and 32min? I haven't detected any issues so far, but my setup is not sensitive enough to detect a single timer being skipped or firing ahead of time.
If you are already dealing with the rollover, it would be nice if you specified that in the documentation.

Also, do you have plans to release a version with a flag so the times can be specified in microseconds?

Thanks!

microseconds timestamp needed

Hi,

Great tool! thank you for sharing.

Is it possible to use microseconds instead milliseconds? If yes, how to?

Is it OK: Test.setInterval(0.1); if I want an interval of 100usec?

Incorrect documentation - stopped vs. paused

In the documentation for the Timer class, you note that void stop() pauses the timer, whereas void pause() resets the timer.

Are these function descriptions the wrong way around? Although, documentation for a function called stop which says "the timer will not stop" is also confusing.

Is a call to stop() then start() effective as a reset?

Can't compile on Nano 33 BLE

Hi,
I get the following error while compiling for a Nano 33:
Blink:12:1: error: 'Timer' does not name a type; did you mean 'time'? Timer timer;

The lib is under Arduino/libraries/Timer

Any suggestion please?
Thanks

Callback function doesn't allow parameters

Hi Bruno
I really like this library of yours and will be using it as part of my Universal Timer project very shortly. I did notice (but am not surprised) that the callback function does not allow parameters to be supplied to the callback function - I have to write a wrapper that then supplies the parameters.

Is there any way that you could allow a construct such as:
timer.setCallback(1000, myFunctionHere(24, 85.1, "GO", true);

Or is this more a restriction of C++. I have to admit I have not inspected your code as I'm tied up creating the YouTube video for the Universal Timer project right now! Very lazy of me, I know.

Anyway, if there is a way of doing the above do let me know (I don't mind forking the code) and thanks again for a great library. Tudo bem!

Ralph Bacon
www.youtube.com/ralphbacon

Deprecated

Hi Bruno,
I'm having an issue where the error is "Including this file is deprecated. Please #include <arduino-timer.h> instead." Does this mean there is no longer support for this timer? I've written my code to suit using your library as it worked perfectly with my code before but now sadly its not. I'm using the same code where it worked previously but now on an ESP32 is that the issue.
Many thanks for your time.

repeat forever does not work with the current Arduino compiler

The repeat_count and total_repeat_count members are supposed to be able to hold the value "-1" to denote repeating forever. But unfortunately these members (and the final arg of setInterval) are declared unsigned, which does not work with current compilers (tested on a Mega board). Changing these to plain int makes it work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.