Imagine | Develop | Create
//#include <EEPROM.h> int ledPin = 11; int buttonPin = 1; int addr = 1; byte fadeValue = 85; void setup() { pinMode(buttonPin, INPUT); //fadeValue = EEPROM.read(addr); analogWrite(ledPin, fadeValue); } void loop() { if(digitalRead(buttonPin) == HIGH) { while(digitalRead(buttonPin) == HIGH){} fadeValue = fadeValue + 85; //EEPROM.write(addr, fadeValue); } analogWrite(ledPin, fadeValue); }