Skip to content

Commit

Permalink
Update TimerInterrupts.ino
Browse files Browse the repository at this point in the history
  • Loading branch information
stevstrong committed Feb 29, 2024
1 parent 95a5e72 commit 1303df3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ void setup()
pinMode(BUTTON_PIN, INPUT_PULLUP);

// Setup LED Timer
Timer2.setMode(TIMER_CH1, TIMER_OUTPUTCOMPARE);
Timer2.setMode(TIMER_CH1, TIMER_OUTPUT_COMPARE);
Timer2.setPeriod(LED_RATE); // in microseconds
Timer2.setCompare(TIMER_CH1, 1); // overflow might be small
Timer2.attachInterrupt(TIMER_CH1, handler_led);

// Setup Counting Timers
Timer3.setMode(TIMER_CH1, TIMER_OUTPUTCOMPARE);
Timer4.setMode(TIMER_CH1, TIMER_OUTPUTCOMPARE);
Timer3.setMode(TIMER_CH1, TIMER_OUTPUT_COMPARE);
Timer4.setMode(TIMER_CH1, TIMER_OUTPUT_COMPARE);
Timer3.pause();
Timer4.pause();
Timer3.setCount(0);
Expand Down

0 comments on commit 1303df3

Please sign in to comment.