Encoder icon indicating copy to clipboard operation
Encoder copied to clipboard

ATMega328 not supported?

Open solidifier opened this issue 6 years ago • 2 comments

See below for errors I get.

I'm pretty sure that these problems are because I'm trying to use it on an Arduino Nano. However, I'm not 100% sure as I still get other errors when compiling for Arduino Mega. Does it also require another timer library to be included?

Anyway, it would be nice to have something in the Readme about what board it requires and maybe a complete example with includes.

......

Arduino: 1.8.9 (Mac OS X), Board: "Arduino Nano, ATmega328P (Old Bootloader)"

Build options changed, rebuilding all sketch/Encoder.cpp: In function 'void setupTimerInterrupt()': Encoder.cpp:12:3: error: 'TCCR3A' was not declared in this scope TCCR3A = 0; // set entire TCCR3A register to 0 ^ Encoder.cpp:13:3: error: 'TCCR3B' was not declared in this scope TCCR3B = 0; // same for TCCR3B ^ Encoder.cpp:14:3: error: 'TCNT3' was not declared in this scope TCNT3 = 0; //initialize counter value to 0 ^ Encoder.cpp:17:3: error: 'OCR3AH' was not declared in this scope OCR3AH = 0; ^ Encoder.cpp:23:3: error: 'OCR3AL' was not declared in this scope OCR3AL = INTERRUPT_PERIOD; ^ Encoder.cpp:26:3: error: 'TIMSK3' was not declared in this scope TIMSK3 = (1 << OCIE3A); ^ Encoder.cpp:26:18: error: 'OCIE3A' was not declared in this scope TIMSK3 = (1 << OCIE3A); ^ Encoder.cpp:29:19: error: 'WGM32' was not declared in this scope TCCR3B |= (1 << WGM32); ^ Encoder.cpp:32:19: error: 'CS30' was not declared in this scope TCCR3B |= (1 << CS30) | (1 << CS31); ^ Encoder.cpp:32:33: error: 'CS31' was not declared in this scope TCCR3B |= (1 << CS30) | (1 << CS31); ^ exit status 1 'TCCR3A' was not declared in this scope

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

solidifier avatar Aug 27 '19 05:08 solidifier

did you resolve this? I have same issue with nano

chrismolloy avatar Feb 25 '21 16:02 chrismolloy

Please can you test if this works now. I just have added support for ATmega328P, using timer 2

John-Lluch avatar Jun 03 '21 20:06 John-Lluch