Several errors compiling

Hello to all.

Im building this:

Usig this code:

And getting these errors:


Arduino:1.8.13 (Windows 10), Tarjeta:"Arduino Uno"

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp: In member function 'void Adafruit_CircuitPlayground::playTone(uint16_t, uint16_t, bool)':

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:215:3: error: 'PLLFRQ' was not declared in this scope

PLLFRQ = (PLLFRQ & 0xCF) | 0x30; // Route PLL to async clk

^~~~~~

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:215:3: note: suggested alternative: 'PCIFR'

PLLFRQ = (PLLFRQ & 0xCF) | 0x30; // Route PLL to async clk

^~~~~~

PCIFR

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:216:3: error: 'TCCR4A' was not declared in this scope

TCCR4A = _BV(COM4A0) | _BV(PWM4A); // Clear on match, PWMA on

^~~~~~

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:216:3: note: suggested alternative: 'TCCR0A'

TCCR4A = _BV(COM4A0) | _BV(PWM4A); // Clear on match, PWMA on

^~~~~~

TCCR0A

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

from C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground/Adafruit_Circuit_Playground.h:20,

from C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:30:

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:216:17: error: 'COM4A0' was not declared in this scope

TCCR4A = _BV(COM4A0) | _BV(PWM4A); // Clear on match, PWMA on

^

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:216:17: note: suggested alternative: 'COM0A0'

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:216:31: error: 'PWM4A' was not declared in this scope

TCCR4A = _BV(COM4A0) | _BV(PWM4A); // Clear on match, PWMA on

^

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:216:31: note: suggested alternative: 'PWM'

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:217:3: error: 'TCCR4B' was not declared in this scope

TCCR4B = _BV(PWM4X) | scalebits; // PWM invert

^~~~~~

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:217:3: note: suggested alternative: 'TCCR0B'

TCCR4B = _BV(PWM4X) | scalebits; // PWM invert

^~~~~~

TCCR0B

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

from C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground/Adafruit_Circuit_Playground.h:20,

from C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:30:

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:217:17: error: 'PWM4X' was not declared in this scope

TCCR4B = _BV(PWM4X) | scalebits; // PWM invert

^

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:217:17: note: suggested alternative: 'PWM'

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:218:3: error: 'TCCR4D' was not declared in this scope

TCCR4D = 0; // Fast PWM mode

^~~~~~

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:218:3: note: suggested alternative: 'TCCR0A'

TCCR4D = 0; // Fast PWM mode

^~~~~~

TCCR0A

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:219:3: error: 'TCCR4E' was not declared in this scope

TCCR4E = 0; // Not enhanced mode

^~~~~~

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:219:3: note: suggested alternative: 'TCCR0A'

TCCR4E = 0; // Not enhanced mode

^~~~~~

TCCR0A

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:220:3: error: 'DT4' was not declared in this scope

DT4 = 0; // No dead time

^~~

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:220:3: note: suggested alternative: 'DD4'

DT4 = 0; // No dead time

^~~

DD4

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:226:3: error: 'TC4H' was not declared in this scope

TC4H = hi1;

^~~~

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:226:3: note: suggested alternative: 'PC4'

TC4H = hi1;

^~~~

PC4

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:227:3: error: 'OCR4C' was not declared in this scope

OCR4C = lo1; // TOP

^~~~~

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:227:3: note: suggested alternative: 'OCR2A'

OCR4C = lo1; // TOP

^~~~~

OCR2A

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:229:3: error: 'OCR4A' was not declared in this scope

OCR4A = lo2; // 50% duty

^~~~~

C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:229:3: note: suggested alternative: 'OCR2A'

OCR4A = lo2; // 50% duty

^~~~~

OCR2A

exit status 1


Any one could help?

Thanks

Looks to me like you’re compiling for the wrong processor.

TheMemberFormerlyKnownAsAWOL:
Looks to me like you're compiling for the wrong processor.

Ive just testet a sketch and works fine :frowning:

Well It looks like Im getting these errors when trying to use

Adafruit_SSD1306 / or Adafruit-GFX-Library

anibaluru:
Ive just testet a sketch and works fine :frowning:

But, a different sketch. Probably one with no processor register references.

Im using ATmega328p CH340G and select Arduino Uno in Boards->

Did you install the required libraries?

 * Required library
 *    TimerOne https://playground.arduino.cc/Code/Timer1
 *    Encoder https://www.pjrc.com/teensy/td_libs_Encoder.html
 *    MIDI https://github.com/FortySevenEffects/arduino_midi_library
 *    Adafruit SSD1306 https://github.com/adafruit/Adafruit_SSD1306

aarg:
Did you install the required libraries?

 * Required library

*    TimerOne https://playground.arduino.cc/Code/Timer1
*    Encoder Encoder Library, for Measuring Quadarature Encoded Position or Rotation Signals
*    MIDI GitHub - FortySevenEffects/arduino_midi_library: MIDI for Arduino
*    Adafruit SSD1306 GitHub - adafruit/Adafruit_SSD1306: Arduino library for SSD1306 monochrome 128x64 and 128x32 OLEDs

Yes, right from those URLs

The UNO has no timer 4. So there can't be any 'TCCR4A' for example... did you change anything in the sketch? Those errors are coming from a "CircuitPlayground" library that is (hopefully) not included in the sketch. Try temporarily uninstalling that library, restart the IDE and try again.

1 Like

aarg:
The UNO has no timer 4. So there can't be any 'TCCR4A' for example... did you change anything in the sketch? Those errors are coming from a "CircuitPlayground" library that is (hopefully) not included in the sketch. Try temporarily uninstalling that library, restart the IDE and try again.

YEAH!!

It was CircuitPlayground messing around.

SOLVED!
Thanks a lot!