Timed code execution of procedures.
Need Timer1 to run. (Compare Match A)
- include timedjob.h
- initialize timedjob
- add jobs
- You'll have to make sure that TIMER1 COMP_A matches every 100ms.
- This is a basic example:
TIMER1_COMPA_VAL0x61A7 (for 16MHz)
TIMER1_COMPA_VAL0x30D3 (for 8MHz)
- (This should work for most setups)
- For other frequencies: value = (freq / 10 / prescaler) - 1
- Example for 4MHz: (4000000 / 10 / 64) - 1 = 6249 = 0x1869
- See examples directory
- Add compiler directives for AVR registers (TIMSK1 / TIMSK are not present on every µC)