Timer1cc Library:

Timer1 Capture/Compare

Timer 1 capture/compare library. This library is specifically for using the capture & compare feature of Timer1.

Current support:

  • ATmega328: Timer1 - mode 4 (CTC)
  • Adjustable prescaler
  • Adjustable rollover value with interrupt
  • Timer capture interrupt

Additional modes and compare output setting could be added to the library.

Usage:

This library has a built-in instance of the class. It is not intended to be instantiated. Use the built-in instance: Timer1. This example initializes Timer1 to rollover and interrupt once per second:

Timer1.initialize(TIMER_DIV256_62500HZ, 62500);
Timer1.attachRolloverInterrupt(myCallback);
Timer1.start();

Share