BUONASERA ,sempre il principiante che si spinge oltre,
è piu' forte di me ci devo tentare, questo e il codice che mi sta facendo a pezzi.
#include <Bridge.h>
#include <EEPROM.h>
const int buttonreset = 4;
int buttonStater = HIGH;
int oldButtonStater = HIGH;
const int buttonPin = 7;
int buttonState = HIGH;
int oldButtonState = HIGH;
int contatoretot1 =0;
int addr_a = 0;
const int buttonPin6 = 6;
int buttonState6 = HIGH;
int oldButtonState6 = HIGH;
int contatore6 =0;
int i = 0;
void setup()
{
Bridge.begin();
delay(1000);
Bridge.put("CONTATORE-TOT-1", String(contatoretot1));
contatoretot1 = EEPROM.read (addr_a);
Bridge.put("CONTATORE-TOT-2", String(contatore6));
contatore6 = EEPROM.read (i);
pinMode(buttonreset,INPUT);
}
void loop() {
buttonState = digitalRead(buttonPin);
/* Every 200ms: */
if (buttonState == LOW && buttonState !=oldButtonState) {
contatoretot1 = contatoretot1 +1; EEPROM.write(addr_a,contatoretot1);
}
oldButtonState = buttonState;
Bridge.put("CONTATORE-TOT-1", String(contatoretot1));
buttonState6 = digitalRead(buttonPin6);
/* Every 200ms: */
if (buttonState6 == LOW && buttonState6 != oldButtonState6) {
contatore6 = contatore6 +1; EEPROM.write(i,contatore6);
}
oldButtonState6 = buttonState6;
Bridge.put("CONTATORE-TOT-2", String(contatore6));
buttonStater = digitalRead (buttonreset);
if (buttonStater == LOW) {contatore6=0;EEPROM.write(i,contatore6);}
}