Data logger on Elegoo Mega R3

Hi everyone,

I have a Data Logger shield which works fine on an Uno, but I cannot get it to work on my Elegoo Mega R3.

Other sketches work fine on the Board, but once the Data Logger shield is attached I am running into problems.

the setup is the following:

And the code I am trying to run is:


#include <SPI.h>
#include "SD_ada.h"

// On the Ethernet Shield, CS is pin 4. Note that even if it's not
// used as the CS pin, the hardware CS pin (10 on most Arduino boards,
// 53 on the Mega) must be left as an output or the SD library
// functions will not work.

const int chipSelect = 4;

File dataFile;

void setup()
{
pinMode(52, OUTPUT);
pinMode(53, OUTPUT);
pinMode(54, OUTPUT);
// Open serial communications and wait for port to open:
Serial.begin(9600);
// while (!Serial) {
// ; // wait for serial port to connect. Needed for Leonardo only
// }

Serial.print("Initializing SD card...");
// make sure that the default chip select pin is set to
// output, even if you don't use it:
pinMode(SS, OUTPUT);

// see if the card is present and can be initialized:
if (!SD.begin(10,11,12,13)) {
Serial.println("Card failed, or not present");
// don't do anything more:
while (1) ;
}
Serial.println("card initialized.");

// Open up the file we're going to log to!
dataFile = SD.open("datalog.txt", FILE_WRITE);
if (! dataFile) {
Serial.println("error opening datalog.txt");
// Wait forever since we cant write data
while (1) ;
}
}

void loop()
{

// make a string for assembling the data to log:
String dataString = F("Hello Mega");
/*
// read three sensors and append to the string:
for (int analogPin = 0; analogPin < 3; analogPin++) {
int sensor = analogRead(analogPin);
dataString += String(sensor);
if (analogPin < 2) {
dataString += ",";
}
}
*/
dataFile.println(dataString);

// print to the serial port too:
Serial.println(dataString);

// The following line will 'save' the file to the SD card after every
// line of data - this will use more power and slow down how much data
// you can read but it's safer!
// If you want to speed up the system, remove the call to flush() and it
// will save the file only every 512 bytes - every time a sector on the
// SD card is filled with data.
dataFile.flush();

// Take 1 measurement every 500 milliseconds
delay(500);
}


The original SD library I replaced with the one from Adafruit and as given in the instructions I changed the line with SD.begin to

if (!SD.begin(10,11,12,13))

But I always get the following error:

/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/sarnold/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/sarnold/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/sarnold/Documents/Arduino/libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -vid-pid=2341_0042 -ide-version=10813 -build-path /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560 -warnings=none -build-cache /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_cache_789906 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/sarnold/Documents/Arduino/Datalogger_Mega/Datalogger_Mega.ino
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/sarnold/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/sarnold/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/sarnold/Documents/Arduino/libraries -fqbn=arduino:avr:mega:cpu=atmega2560 -vid-pid=2341_0042 -ide-version=10813 -build-path /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560 -warnings=none -build-cache /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_cache_789906 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/sarnold/Documents/Arduino/Datalogger_Mega/Datalogger_Mega.ino
Using board 'mega' from platform in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
Using core 'arduino' from platform in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
Detecting libraries used...
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/sketch/Datalogger_Mega.ino.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for SPI.h: [SPI@1.0]
ResolveLibrary(SPI.h)
-> candidates: [SPI@1.0]
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/sketch/Datalogger_Mega.ino.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
Alternatives for SD_ada.h: [SD_adafruit]
ResolveLibrary(SD_ada.h)
-> candidates: [SD_adafruit]
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/sketch/Datalogger_Mega.ino.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src/SPI.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit/utility /Users/sarnold/Documents/Arduino/libraries/SD_adafruit/File.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit/utility /Users/sarnold/Documents/Arduino/libraries/SD_adafruit/SD_ada.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit/utility /Users/sarnold/Documents/Arduino/libraries/SD_adafruit/utility/Sd2Card.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit/utility /Users/sarnold/Documents/Arduino/libraries/SD_adafruit/utility/SdFile.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit/utility /Users/sarnold/Documents/Arduino/libraries/SD_adafruit/utility/SdVolume.cpp -o /dev/null -DARDUINO_LIB_DISCOVERY_PHASE
Generating function prototypes...
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/sketch/Datalogger_Mega.ino.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/preproc/ctags_target_for_gcc_minus_e.cpp -DARDUINO_LIB_DISCOVERY_PHASE
/Applications/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/preproc/ctags_target_for_gcc_minus_e.cpp
Sketch wird kompiliert...
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/sketch/Datalogger_Mega.ino.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/sketch/Datalogger_Mega.ino.cpp.o
Compiling libraries...
Compiling library "SPI"
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src/SPI.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/libraries/SPI/SPI.cpp.o
Compiling library "SD_adafruit"
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit/utility /Users/sarnold/Documents/Arduino/libraries/SD_adafruit/File.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/libraries/SD_adafruit/File.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit/utility /Users/sarnold/Documents/Arduino/libraries/SD_adafruit/SD_ada.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/libraries/SD_adafruit/SD_ada.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit/utility /Users/sarnold/Documents/Arduino/libraries/SD_adafruit/utility/Sd2Card.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/libraries/SD_adafruit/utility/Sd2Card.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit/utility /Users/sarnold/Documents/Arduino/libraries/SD_adafruit/utility/SdVolume.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/libraries/SD_adafruit/utility/SdVolume.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI/src -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit -I/Users/sarnold/Documents/Arduino/libraries/SD_adafruit/utility /Users/sarnold/Documents/Arduino/libraries/SD_adafruit/utility/SdFile.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/libraries/SD_adafruit/utility/SdFile.cpp.o
Compiling core...
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc -c -g -x assembler-with-cpp -flto -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/wiring_pulse.S -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/wiring_pulse.S.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/wiring_analog.c -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/wiring_analog.c.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/wiring.c -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/wiring.c.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WInterrupts.c -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/WInterrupts.c.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/hooks.c -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/hooks.c.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/wiring_digital.c -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/wiring_digital.c.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/wiring_pulse.c -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/wiring_pulse.c.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/wiring_shift.c -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/wiring_shift.c.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/CDC.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/CDC.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/HardwareSerial1.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/HardwareSerial1.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/HardwareSerial.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/HardwareSerial.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/HardwareSerial0.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/HardwareSerial0.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/HardwareSerial2.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/HardwareSerial2.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/HardwareSerial3.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/HardwareSerial3.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/IPAddress.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/IPAddress.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/PluggableUSB.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/PluggableUSB.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/Print.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Stream.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/Stream.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Tone.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/Tone.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/USBCore.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/USBCore.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WMath.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/WMath.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WString.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/WString.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/abi.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/abi.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/main.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/main.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/mega /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/new.cpp -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/new.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/wiring_pulse.S.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/WInterrupts.c.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/hooks.c.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/wiring.c.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/wiring_analog.c.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/wiring_digital.c.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/wiring_pulse.c.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/wiring_shift.c.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/CDC.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/HardwareSerial.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/HardwareSerial0.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/HardwareSerial1.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/HardwareSerial2.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/HardwareSerial3.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/IPAddress.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/PluggableUSB.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/Print.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/Stream.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/Tone.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/USBCore.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/WMath.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/WString.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/abi.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/main.cpp.o
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc-ar rcs /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/new.cpp.o
Gebauter Kern wird archiviert (zwischengespeichert) in: /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_cache_789906/core/core_arduino_avr_mega_cpu_atmega2560_51f02b7210b938436b779d1c032618e1.a
Linking everything together...
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega2560 -o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/Datalogger_Mega.ino.elf /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/sketch/Datalogger_Mega.ino.cpp.o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/libraries/SPI/SPI.cpp.o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/libraries/SD_adafruit/File.cpp.o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/libraries/SD_adafruit/SD_ada.cpp.o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/libraries/SD_adafruit/utility/Sd2Card.cpp.o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/libraries/SD_adafruit/utility/SdFile.cpp.o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/libraries/SD_adafruit/utility/SdVolume.cpp.o /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/core/core.a -L/var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560 -lm
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/Datalogger_Mega.ino.elf /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/Datalogger_Mega.ino.eep
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-objcopy -O ihex -R .eeprom /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/Datalogger_Mega.ino.elf /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/Datalogger_Mega.ino.hex
Bibliothek SPI in Version 1.0 im Ordner: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/libraries/SPI wird verwendet
Bibliothek SD_adafruit im Ordner: /Users/sarnold/Documents/Arduino/libraries/SD_adafruit (legacy) wird verwendet
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-size -A /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/Datalogger_Mega.ino.elf
Der Sketch verwendet 12228 Bytes (4%) des Programmspeicherplatzes. Das Maximum sind 253952 Bytes.
Globale Variablen verwenden 960 Bytes (11%) des dynamischen Speichers, 7232 Bytes für lokale Variablen verbleiben. Das Maximum sind 8192 Bytes.
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega2560 -cwiring -P/dev/cu.usbmodem14201 -b115200 -D -Uflash:w:/var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/Datalogger_Mega.ino.hex:i

avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
     User configuration file is "/Users/sarnold/.avrduderc"
     User configuration file does not exist or is not a regular file, skipping

     Using Port                    : /dev/cu.usbmodem14201
     Using Programmer              : wiring
     Overriding Baud Rate          : 115200
     AVR Part                      : ATmega2560
     Chip Erase delay              : 9000 us
     PAGEL                         : PD7
     BS2                           : PA0
     RESET disposition             : dedicated
     RETRY pulse                   : SCK
     serial program mode           : yes
     parallel program mode         : yes
     Timeout                       : 200
     StabDelay                     : 100
     CmdexeDelay                   : 25
     SyncLoops                     : 32
     ByteDelay                     : 0
     PollIndex                     : 3
     PollValue                     : 0x53
     Memory Detail                 :

                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom        65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
       flash         65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
       lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

     Programmer Type : Wiring
     Description     : Wiring
     Programmer Model: AVRISP
     Hardware Version: 15
     Firmware Version Master : 2.10
     Vtarget         : 0.0 V
     SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9801 (probably m2560)
avrdude: reading input file "/var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/Datalogger_Mega.ino.hex"
avrdude: writing flash (12228 bytes):

Writing | ################################################## | 100% 1.97s

avrdude: 12228 bytes of flash written
avrdude: verifying flash memory against /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/Datalogger_Mega.ino.hex:
avrdude: load data flash data from input file /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/Datalogger_Mega.ino.hex:
avrdude: input file /var/folders/6m/3_6jd6dj1fzc96jd16zgm5j80000gp/T/arduino_build_143560/Datalogger_Mega.ino.hex contains 12228 bytes
avrdude: reading on-chip flash data:

Reading | ###############################################Beim Hochladen des Sketches ist ein Fehler aufgetreten

| 100% 1.56s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0b6c
0x8e != 0xce
avrdude: verification error; content mismatch

Hope that anyone can help me.

Best regards

Can you upload the sketch if you remove the shield?

Further, I have a little bit of doubt if that shield will work straight away with the Mega. It looks like the shield is designed for an Uno (can you provide a link please) in which case the SPI pins on the Mega are on a different location; check the Mega's pinout diagram.

Hi,

thanks for your answer.
The logger is this one:
https://forum.hobbycomponents.com/viewtopic.php?f=40&t=1779

The sketch won't upload even without the shield. But other sketches (blink etc.) work fine.

I know about the different pinout, which is why I used the SD library from Adafruit and
replaced the SD.begin with:
if (!SD.begin(10,11,12,13))

according to this tutorial:

I also rewired SDL and SDC.

Best regards