I'm not quite sure about the "10%" ect, or why you're using different EEPROM adresses, but if you could change some stuff around to make it simpler like this, you'd save some ram. Start by making an Integer or byte that holds the contrast value eg. 30.
This code:
if(used.item.getName() == "30%") {
if(EEPROM.read(3) != 70) {
EEPROM.write(3,70);
}
}
becomes this:
if(contrast == 30) {
if(EEPROM.read(3) != 70) {
EEPROM.write(3,70);
}
}
if(contrast == 40) {
if(EEPROM.read(3) != 60) {
EEPROM.write(3,60);
}
}
if(contrast == 50) {
if(EEPROM.read(3) != 50) {
EEPROM.write(3,50);
}
}
// continue for all the values of contrast.....
lcd.print ("Contrast= ");
lcd.print (contrast);
lcd.print ("%");
Which can be further simplifies if you can change some EEPROM adresses to make it work like this with all the values:
if(EEPROM.read(3) != (100 - contrast)) {
EEPROM.write(3, (100 - contrast));
}
lcd.print ("Contrast= ");
lcd.print (contrast);
lcd.print ("%");