Created
September 1, 2016 12:29
-
-
Save ringodin/5c04319364e43625697586a058777b17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int yellow = 7; | |
int red = 6; | |
int speakerPin = 8; | |
// the setup function runs once when you press reset or power the board | |
void setup() { | |
pinMode(7, OUTPUT); | |
pinMode(6, OUTPUT); | |
} | |
// the loop function runs over and over again forever | |
void loop() { | |
digitalWrite(yellow, HIGH); // turn the LED on (HIGH is the voltage level) | |
delay(500); // wait for a second | |
digitalWrite(yellow, LOW); // turn the LED off by making the voltage LOW | |
delay(500); | |
digitalWrite(red, HIGH); // turn the LED on (HIGH is the voltage level) | |
delay(500); // wait for a second | |
digitalWrite(red, LOW); // turn the LED off by making the voltage LOW | |
delay(500); | |
tone(speakerPin, 440, 200); //play tone on pin 8 of 440 Hz for 200 ms | |
delay(200); | |
tone(speakerPin, 240, 200); //play tone on pin 8 of 240 Hz for 200 ms | |
delay(200); | |
tone(speakerPin, 120, 200); | |
delay(200); | |
tone(speakerPin, 440, 200); | |
delay(200); | |
tone(speakerPin, 80, 200); | |
delay(200); | |
noTone(speakerPin); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment