int i = 0;
int presscount = 0;
int rounds = 0;
int extled = 13;
const int button1 = 10;
const int button2 = 11;
int button2state = 0;
int voltage1 = 0;
int voltage2 = 0;
void setup(){
Serial.begin(9600);
pinMode(extled, OUTPUT);
pinMode(button1, INPUT);
pinMode(button2, INPUT);
Serial.println("Hello World!");
Serial.println("This is me calling you");
pinMode(LED_BUILTIN,OUTPUT);
}
void loop(){
digitalWrite(LED_BUILTIN, voltage1);
digitalWrite(extled,voltage2 );
delay(100);
rounds++;
if (digitalRead(button2)==LOW){
Serial.println("stopped");
Serial.println("you pressed button " + String(presscount) + " times");
delay(1000);
exit(0);
}
String Message = "I like C round ";
if (rounds == 20){
voltage1 = HIGH;
voltage2 = LOW;
i++;
Serial.println(Message+i);
}
else if (rounds ==40){
i++;
voltage1 = LOW;
voltage2 = HIGH;
Serial.println(Message+i);
rounds = 0;
}
if (digitalRead(button1) == LOW){
presscount++;
}
}