ivanseidel / ivanseidel/DueTimer
Change timer value on the fly
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 217
- Forks
- 87
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
i want to change the timer intervall on the fly
i generate the intervall time with an formula
```
int myVar = 0;
double ticks = 60000000.0 / (myVar * 96.0);
void clock1()
{
// do stuff here
}
void setup()
{
Timer2.attachInterrupt(clock1);
}
void loop ()
{
if ( something == 1)
{
Timer2.start(ticks);
}
if ( somethingElse)
{
myVar = 120;
}
}
}
```
how can i update the changed value on the fly? do i have to stop and start the Timer again ?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the implementation and usage of Timer2.start and Timer2.attachInterrupt, then trace how the interval is stored and applied while the timer is running. Determine whether changing the calculated ticks value can affect an active timer or requires restarting it. Done means the supported behavior for updating an interval on the fly is clear and reproducible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- arduino, cpp
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100