void setup() {
pinMode(9, OUTPUT);//Setup for pin
pinMode(10, OUTPUT);//Setup for pin
pinMode(11, OUTPUT);//Setup for pin
pinMode(A4, INPUT);//Setup for pin
pinMode(3, OUTPUT);//Setup for pin
}
int led13 = 13;//Initialises and assorts name for the LED pin
int led12 = 12;//Initialises and assorts name for the LED pin
int led11 = 11;//Initialises and assorts name for the LED pin
int led10 = 10;//Initialises and assorts name for the LED pin
int led9 = 9;//Initialises and assorts name for the LED pin
int led8 = 8;//Initialises and assorts name for the LED pin
int photoresistor;//Initialising photoresistor pin
int buzzer = 3;//Initialising pin number for buzzer
void loop() {
photoresistor = digitalRead(A4);//Initialising function of photoresistor
digitalWrite(led10, HIGH);//Turning on LED
digitalWrite(led9, HIGH);//c
digitalWrite(led11, LOW);//Turning off LED
digitalWrite(led9, LOW);//Turning off LED
digitalWrite(led10, LOW);//Turning off LED
digitalWrite(led11, LOW);//Turning off LED
delay(300);
if (photoresistor < 100){//Initialising photoresistor brightness intake
digitalWrite(led8, HIGH);//Turning off LED
digitalWrite(led9, HIGH);//Turning off LED
digitalWrite(led10, HIGH);//Turning off LED
}
tone(3, 440, 500);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 494, 750);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 440, 500);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 994, 1000);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 440, 500);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 440, 3000);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 440, 500);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 994, 1000);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 440, 500);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 440, 3000);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 20, 750);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 20, 750);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 20, 750);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
tone(3, 20, 750);//Sets tone for buzzer, sets tone frequency, sets the amount of time the sound will go for
}
Comments
Please log in or sign up to comment.