Created
August 5, 2015 10:49
-
-
Save michaelsarduino/76e67edc69ad9f8a6576 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#define NOTE_D5 587 | |
#define NOTE_A5 880 | |
void setup() { | |
pinMode(13, INPUT); | |
pinMode(12, INPUT); //sensoren | |
pinMode(10, OUTPUT); //blau | |
pinMode(9, OUTPUT); | |
pinMode(8, OUTPUT); //rot | |
} | |
void loop() { | |
while(digitalRead(13) == HIGH || digitalRead(12) == HIGH) | |
{ | |
for(int i = 0; i < 5; i++) | |
{ | |
tone(11, NOTE_A5, 200); | |
delay(125); | |
noTone(11); | |
tone(11, NOTE_D5, 125); | |
delay(125); | |
noTone(11); | |
} | |
for(int i = 0; i < 10; i++) | |
{ | |
digitalWrite(10, HIGH); | |
delay(250); | |
digitalWrite(10, LOW); | |
digitalWrite(9, HIGH); | |
digitalWrite(8, HIGH); | |
delay(250); | |
digitalWrite(9, LOW); | |
digitalWrite(8, LOW); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment