const int LED_PIN_1 = 13;
const int LED_PIN_2 = 12;
const int LED_PIN_3 = 11;
const int button_1 = 7;
const int button_2 = 6;
const int button_3 = 5;
const int button_4 = 4;
const int Buzzer_Pin = 10;
int ButtonState1 = 0;
int ButtonState2 = 0;
int ButtonState3 = 0;
int ButtonState4 = 0;
int LED_PIN_2BlinkDelay = LOW;
int LED_PIN_3_Brightness = 0;
void setup() {
pinMode(LED_PIN_1, OUTPUT);
pinMode(LED_PIN_2, OUTPUT);
pinMode(LED_PIN_3, OUTPUT);
pinMode(button_1, INPUT_PULLUP);
pinMode(button_2, INPUT_PULLUP);
pinMode(button_3, INPUT_PULLUP);
pinMode(button_4, INPUT_PULLUP);
pinMode(Buzzer_Pin, OUTPUT);
}
void loop() {
ButtonState1 = digitalRead(button_1);
if (digitalRead(ButtonState1) == HIGH)
{ digitalWrite(LED_PIN_1, HIGH);
tone(Buzzer_Pin, 350);
}
else {
digitalWrite(LED_PIN_1, LOW);
noTone(Buzzer_Pin);
}
ButtonState2 = digitalRead(button_2);
if (digitalRead(ButtonState2) == HIGH)
{
LED_PIN_2BlinkDelay = 100;
}
ButtonState3 = digitalRead(button_3);
if (digitalRead(ButtonState3) == HIGH)
{
LED_PIN_2BlinkDelay = 1500;
}
digitalWrite(LED_PIN_2, HIGH);
delay(LED_PIN_2BlinkDelay);
digitalWrite(LED_PIN_2, LOW);
delay(LED_PIN_2BlinkDelay);
ButtonState4 = digitalRead(button_4);
if (digitalRead(ButtonState4) == HIGH)
{
LED_PIN_3_Brightness = 255;
}
else (digitalRead(ButtonState4) == LOW);
{
LED_PIN_3_Brightness = 0;
}
}