//00515
void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT);
pinMode(12, INPUT_PULLUP);
}
int State=0;
int newBts = 0;
int oldBts=0;
int cl=0;
void loop() {
// put your main code here, to run repeatedly:
newBts=digitalRead(12);
if ((oldBts!=newBts) and (newBts==0)){
cl++;
if (cl%2==0){
if(State==1) {
digitalWrite(13,0);
State=0;
}
else {
digitalWrite(13,1);
State = 1;
}
}
}
oldBts = newBts;
delay(50);
}