Storing data

This example is for Wiring version 1.0 build 0100+. If you have a previous version, use the examples included with your software. If you see any errors or have comments, please let us know.

HelloEEPROMVar by BREVIG * A simple example that uses this library to store a variable that will be saved and persist through power cycles. Great for settings

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

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

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

void loop() {
  //nothing to loop