Activity 4 Countdown Counter

mail@pastecode.io avatar
unknown
c_cpp
a month ago
473 B
1
Indexable
Never
void setup() {
  // put your setup code here, to run once:
pinMode(8,OUTPUT); //set pin 8 to output
pinMode(13,OUTPUT); //set pin 13 to output

for(int i=0; i<10; i++){ //loop 10 times
digitalWrite(8,HIGH); // LED on and off 1 hz
delay(500);
digitalWrite(8,LOW);
delay(500);} //repeat

}

void loop() {
  //alarm noise
tone(13,400); //turn on buzzer to frequency 400
delay(750); //wait .75 sec
noTone(13); //turn off buzzer
delay(750); //wait .75 sec
}
Leave a Comment