int readPush=10;
int dt =100;
int LED=7;
int LEDState=0;
int buttonNew;
int buttonOld=1;
void setup() {
// put your setup code here, to run once:
Serial.begin (9600);
pinMode(readPush,INPUT);
pinMode(LED,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
buttonNew =digitalRead(readPush);
if (buttonOld == 1 && buttonNew == 0){
if (LEDState==0){
digitalWrite (LED,HIGH);
LEDState = 1;
}
else {
digitalWrite (LED,LOW);
LEDState = 0;
}
}
Serial.println(buttonNew);
delay(dt);
}