#include <avr/eeprom.h>
const int buttonPin = 2;
int buttonState = 0;
struct settings_t
{
long alarm;
int mode;
} settings;
void setup()
{
eeprom_read_block((void*)&settings, (void*)0, sizeof(settings));
// ...
}
void loop()
{
buttonState = digitalRead(buttonPin);
// let the user adjust their alarm settings
// let the user adjust their mode settings
// ...
settings.mode = analogRead(A0); // potentiometer on A0
// if they push the "Save" button, save their configuration
if (buttonState == HIGH) // button attached on digital pin 2
eeprom_write_block((const void*)&settings, (void*)0, sizeof(settings));
}