1
2#define r1 11
3#define Buzzer 10
4int relay1 = LOW;
5#define BUTTON_PIN 7
6void setup() {
7 pinMode(r1, OUTPUT);
8 pinMode(Buzzer, OUTPUT);
9 pinMode(BUTTON_PIN, INPUT);
10}
11void loop() {
12 if (digitalRead(BUTTON_PIN) == HIGH)
13 {
14 relay1 = ~ relay1;
15 digitalWrite(r1, relay1);
16 digitalWrite(Buzzer, HIGH);
17 delay(1000);
18 digitalWrite(Buzzer, LOW);
19
20 }
21
22}
23