Libraries \ EEPROMVar

Reference for Wiring version 1.0 Build 0100+ If you have a previous version, use the reference included with your software. If see any errors or have any comments, let us know.

Name

EEPROMVar

Examples
#include <EEPROM.h>
#include <EEPROMVar.h>

EEPROMVar<int> eepromRunCounts(1);
EEPROMVar<float> eepromPI(3.1415f);

void setup() 
{
  Serial.begin(115200);
  Serial.print("This program has been ran ");
  Serial.print(eepromRunCounts);
  if (eepromRunCounts==1) 
  {
    Serial.println(" time.");
  } 
  else 
  {
    Serial.println(" times.");
  }
  Serial.print("As it multiplies PI by two each execution, the current value is ");
  Serial.println(eepromPI);
  
  eepromRunCounts++;
  eepromPI *= 2;
}

void loop() {
  //nothing to loop
}
Description Initializes the EEPROMVar. This is a library for variables that need to persist through power cycles. It automatically saves to EEPROM every time the value changes
Syntax
EEPROMVar < datatype > variable(value)
Parameters
datatype the datatype for the variable
variable variable name referencing the value
value The initial value for this EEPROMVar variable
Returns None
Usage Application
Updated on July 07, 2011 11:09:52pm PDT

Creative Commons License