I’m trying to directly modify the timer 2 bits on the Arduino Due with something like this:
pinMode(3, OUTPUT);
pinMode(11, OUTPUT);
TCCR2A = _BV(COM2A0) | _BV(COM2B1) | _BV(WGM21) | _BV(WGM20);
TCCR2B = _BV(WGM22) | _BV(CS20);
OCR2A = 29;
OCR2B = 14;
However if I compile that code I get the error message “‘TCCR2A’ was not declared in this scope’”
So I tried adding the line: #include <avr/interrupt.h>
But this results in the error “fatal error: avr/interrupt.h: No such file or directory compilation terminated.” All the other forums I’ve read said that this library does not need to be manually added but I’m not sure how to check to see if it’s there or not.
Any help would be much appreciated.