.Write a code when switch is off buzzer on and 4 led off blinking else buzzer off and 4 led start blinking when switch is off
Answers
Answered by
1
Answer:
program is added in the attachment
Attachments:
Answered by
1
Answer:
int led=13; //declare pin 13 of arduino as led pin
int buzzer=8; // declare pin 8 of arduino as buzzer pin
void setup()
{
pinMode(led,OUTPUT); //set yhe led pin as output
pinMode(buzzer,OUTPUT); //set the buzzer pin as output
}
void loop()
{
digitalWrite(led,HIGH); //turning led on
delay(1);
digitalWrite(buzzer,HIGH);// turning buzzer on
delay(1000); //delay of 1 second
digitalWrite(led,LOW); //turning led off
delay(1);
digitalWrite(buzzer,LOW); //turning led off
delay(1000);
}
Explanation:
Similar questions