Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: 'class EEPROMClass' has no member named 'get' or 'put' #25

Open
StefanMeGit opened this issue Sep 11, 2018 · 1 comment
Open

Comments

@StefanMeGit
Copy link

Hi! I try to port some code form an Arduino Nano to an Feather M0 Cortex. I run into a problem with the get and put function. Is it not possible to use?

I run with #include <FlashAsEEPROM.h>

void loadEEPROMSettings() {
  // Load settings from EEPROM to custom struct
  EEPROM.get(0, txSettings);

  bool rewriteSettings = false;

  // Loop through all settings to check if everything is fine
  for (uint8_t i = 0; i < numOfSettings; i++) { 

    // If setting default value is -1, don't check if its valid
    if( rules[i][0] != -1 ){

      short val = getSettingValue(i);
    
      if (! inRange(val, rules[i][1], rules[i][2])) {
        // Setting is damaged or never written. Rewrite default.
        rewriteSettings = true;
        setSettingValue(i, rules[i][0] );
      }
    }
  }

  if(txSettings.firmVersion != VERSION){
    
    setDefaultEEPROMSettings();
    
  }
  else if (rewriteSettings == true) {
    updateEEPROMSettings();
  }
  
  // Calculate constants
  calculateRatios();

}

/* 
 * Write settings to the EEPROM then exiting settings menu.
 */
void updateEEPROMSettings() {
  EEPROM.put(0, txSettings);
  calculateRatios();
}
@ZachAllenVisuals
Copy link

I have no idea if this applies to you, but I had strange behaviors when I was using the Arduino IDE provided by the Synaptic Package Manager on Linux, and it was fixed by downloading and installing from arduino.cc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants