error compiling for board Arduino/Genguino Mega or Mega 2560

Arduino: 1.8.8 (Windows Store 1.8.19.0) (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\jasto\Documents\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp: In member function 'void Adafruit_CircuitPlayground::playTone(uint16_t, uint16_t, bool)':

C:\Users\jasto\Documents\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:201:3: error: 'PLLFRQ' was not declared in this scope

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

^

In file included from c:\program files\windowsapps\arduinollc.arduinoide_1.8.19.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\io.h:99:0,

from c:\program files\windowsapps\arduinollc.arduinoide_1.8.19.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28,

from C:\Users\jasto\Documents\Arduino\libraries\Adafruit_Circuit_Playground/Adafruit_Circuit_Playground.h:20,

from C:\Users\jasto\Documents\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:30:

C:\Users\jasto\Documents\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:202:31: error: 'PWM4A' was not declared in this scope

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

^

C:\Users\jasto\Documents\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:203:17: error: 'PWM4X' was not declared in this scope

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

^

C:\Users\jasto\Documents\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:204:3: error: 'TCCR4D' was not declared in this scope

TCCR4D = 0; // Fast PWM mode

^

C:\Users\jasto\Documents\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:205:3: error: 'TCCR4E' was not declared in this scope

TCCR4E = 0; // Not enhanced mode

^

C:\Users\jasto\Documents\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:206:3: error: 'DT4' was not declared in this scope

DT4 = 0; // No dead time

^

C:\Users\jasto\Documents\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:212:3: error: 'TC4H' was not declared in this scope

TC4H = hi1;

^

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

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

Where did you get the code? Why do you assume that it WILL compile for a Mega?

The code came from an instructable , the article was setup for this board

here is what i downloaded

DFR_Key.cpp (1.61 KB)

DFR_Key.h (529 Bytes)

multiCameraIrControl.cpp (7.56 KB)

multiCameraIrControl.h (2.67 KB)

scanner_firmware.ino (5.85 KB)

am I missing something in libraries?

The error messages come from compiling Adafruit_CircuitPlayground.cpp, which seems to have nothing to do with this project.

Perhaps enabling verbose mode when compiling will show why the compiler is trying to compile that file.

in verbose mode it shows:

Arduino: 1.8.8 (Windows Store 1.8.19.0) (Windows 10), Board: “Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)”

C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__mdqgnx93n4wtt\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__mdqgnx93n4wtt\hardware -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__mdqgnx93n4wtt\tools-builder -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__mdqgnx93n4wtt\hardware\tools\avr -built-in-libraries C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__mdqgnx93n4wtt\libraries -libraries C:\Users\jasto\Documents\Arduino\libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -vid-pid=0X2341_0X0042 -ide-version=10808 -build-path C:\Users\jasto\AppData\Local\Temp\arduino_build_878638 -warnings=none -build-cache C:\Users\jasto\AppData\Local\Temp\arduino_cache_156277 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.arduinoOTA.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__mdqgnx93n4wtt\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__mdqgnx93n4wtt\hardware\tools\avr -verbose C:\Users\jasto\Desktop\FAPJ9GWIJYV1557 (3)\scanner_firmware1.1\scanner_firmware\scanner_firmware.ino
FindFirstFile C:\Users\jasto\AppData\Local\Temp\arduino_cache_156277: The system cannot find the file specified.

Error compiling for board Arduino/Genuino Mega or Mega 2560.

jastone:

C:\Users\jasto\Documents\Arduino\libraries\Adafruit_Circuit_Playground\Adafruit_CircuitPlayground.cpp:201:3: error: 'PLLFRQ' was not declared in this scope

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

^

I already explained the cause of these errors to you 3 days ago in your previous thread:

jastone:

FindFirstFile C:\Users\jasto\AppData\Local\Temp\arduino_cache_156277: The system cannot find the file specified.

This is a completely different issue. Try exiting all Arduino IDE windows and then start the Arduino IDE again. That will clear the cache and hopefully fix the issue.

and I thank you for your explanation a few days ago. I did that early this morning and now I have other issues

DFR_Key.h: no such file or directory

When you see a "No such file or directory" error it almost always means you need to install the library that contains the missing file.

Often the code you're compiling will come with documentation (either a comment or separate document) that tells you where to get the library dependencies.

In other cases the author of the code will not have been so kind and you'll need to go on a hunt for the missing library.

A good place to start is the Arduino IDE's Library Manager:

  • Sketch > Include Library > Manage Libraries...
  • In the "Filter your search..." box, type some keywords you have gleaned from the missing file name.
  • Scroll through the results for the right library. Click on it.
  • Click "Install".
  • Wait for installation to finish.
  • Click "Close".
  • Try compiling your code again.

If you have no luck in Library Manager then load up your favorite search engine and do a search for the missing filename. You will often get multiple results. If you have a lot of results you might add "arduino" as an additional search keyword. I will usually prefer results on github.com since that is where most Arduino libraries are hosted and downloading from there is fast and easy. In some cases there will be multiple libraries that contain the given filename and you'll need to do some evaluation to determine which seems the most appropriate, then try it out. After downloading the library you found you'll need to install it. This requires a different process than the Library Manager installation. You will find instructions here:

Are you using the Arduino IDE from the windows store or the direct download from this website?

I downloaded your files, and also the files from the instructables website, and don't have any problem compiling either. The files you posted here are identical to the originals, so you haven't made any changes. There are a few compiler warnings, but nothing that keeps it from compiling.

Are the 5 files you posted the only files in the scanner_firmware directory? When you open scanner_firmware.ino do you get 5 tabs open in the IDE?

Ah, I didn't see you were using the scanner_firmware1.1 version from Instructables. So disregard my previous reply, you already have the missing file, you just need to put it in the right place, as already explained by david_nc.