This sketch shows a working example of saving variables to the eeprom using eeprom.get and eeprom.put. There is an alarm that sounds a buzzer when an object is within a re-set-able distance (in inches) from an object, and also 3 leds that turn on in succession 3 inches apart prior to sounding the alarm to indicate the set distance to the object has been reached. Two push buttons are used to increment and decrement the alarm distance. Another push button is set up to turn the alarm on and off. An LCD is used to view the distance in inches and centimeters when an object is placed in front of the sensor and also prints to the LCD if the alarm is set to on or off.