Eeprom behaves unpretictable

Hi
I am building a midi Controller with an mega and want to save and load settings with the eeprom but some how it seems that it changes stuff like the addresses by itself.
I was trying multiple Versions of an eeprom library and also things like writing and reading works if only done with test data and not my objects.

Is there something like
Do not use multiple write and read calls after each other
Do not use defines for addresses
Do not use objects to write th3 read data

I am really frustrated as I used eeprom before for example on an uno for saving timer data and such but as extensive as in This project I guess

bitbucket.org/curi/arduinomidicontroller
For the full project if you want to have a Look.

I do not susbect anybody to Remotely and magically solve my Problem but maybe you have some Tricks and Tipps for me.

Otherwise I will have to Look into SD cards and parsing Text files I guess

void ButtonSwitch::loadBtnFromEeprom()
{
  int address = this->startAddress;
  byte firstChannels[6];
  firstChannels[0] = EEPROM.read(address + FIRST_BTN_TUPLE + BTN_FIRST_CHANNEL);
  delay(10);
  address = this->startAddress;
  firstChannels[1] = EEPROM.read(address + SECOND_BTN_TUPLE + BTN_FIRST_CHANNEL);
  delay(10);
  address = this->startAddress;
  firstChannels[2] = EEPROM.read(address + THIRD_BTN_TUPLE + BTN_FIRST_CHANNEL);
  delay(10);
  address = this->startAddress;
  firstChannels[3] = EEPROM.read(address + FOURTH_BTN_TUPLE + BTN_FIRST_CHANNEL);
  delay(10);
  address = this->startAddress;
  firstChannels[4] = EEPROM.read(address + FIFTH_BTN_TUPLE + BTN_FIRST_CHANNEL);
  delay(10);
  address = this->startAddress;
  firstChannels[5] = EEPROM.read(address + SIXTH_BTN_TUPLE + BTN_FIRST_CHANNEL);
  delay(10);
  address = this->startAddress;
  changeChannels(firstChannels);
  
  byte firstTypes[6];
  firstTypes[0] = EEPROM.read(address + FIRST_BTN_TUPLE + BTN_FIRST_TYPE);
  delay(10);
  address = this->startAddress;

curimania:
Is there something like
Do not ...

Yes.

Do not ask questions without posting complete code (often a minimal example showing the error works best).
Do not assume that Strings can be saved to EEPROM without effort.
Do not write single cells too often.

Hmm, need to login on that bitbucket site. So that's a no.

Post your code here (please read How to use this forum - please read, specifically point 7 about posting code and if the code exceeds 9kB, point 8 about attaching files).

Or even better, as said above, a simple example that shows your problem.

I added a small snipped which basically tepeats this way more times

So I add a small snippet of the answer, you just have to...

Very Funny indeed.
I think this is a problem caused by the repetetive usage of wiriting to different addresses repeateadly, so I really think my repetetive Code which as said is the added Code over and over again will not really help in under standing my Problem.
Maybe it is even caused by using the cli interface on a Linux System for compiling and uploading sketches.
Maybe it is because c11 did not Support things I used in my Code.
Maybe it is because the eeprom library is not that stabile on an mega.
Never the less. Thanks for your time and sorry for the inconvience but I guess I will just add a SD card.

The probability that you are doing something wrong is immense.

You only show a small part of some gruesome code that does not compile.

How could someone even give a hint without all the missing defines and definitions?

If you are interested in solving the issue, provide a compiling example of the error.
And a decent description how the actual behaviour differs from your expectations.

BTW working with EEPROM is much simpler than using an SD card.

My projects is compiling without error and also uploads and runs.
The only thing that is weird is that it seems to load and save to ever changing addresses.
I will Post the whole project files when beeing at a computer again and not fiddeling on an Smartphone.

Here are alle the files from my repo never the less

And the makefile:

ARDUINO_DIR = /usr/share/arduino-1.8.8/
BOARD_TAG = mega
BOARD_SUB = atmega2560
ARDUINO_PORT = /dev/ttyUSB0
ARDUINO_LIBS = EEPROM Wire NewliquidCrystal
DF_CPU = 16000000L
include /usr/share/arduino/Arduino.mk

arduinomidicontroller.ino (28.7 KB)

ButtonSwitch.cpp (17.1 KB)

ButtonSwitch.h (1.1 KB)

MyConfig.h (2.89 KB)

MyEncoder.cpp (1.7 KB)

MyEncoder.h (501 Bytes)

Potentiometer.cpp (12.2 KB)

Potentiometer.h (1005 Bytes)

The probability that you are doing something wrong is immense.
You only show a small part of some gruesome code that does not compile.
Without all the missing defines and definitions you are expecting hint from someone.

If you are interested in solving the issue, provide a compiling example of the errors.
And a decent description how the actual behavior differs from your expectations.