Created
October 19, 2017 07:02
-
-
Save peter-jung/0ae4f1de4d50436ebe57af587b150be8 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
/* | |
* 1:1 Lichttunnel | |
* Kuzmin 2017 | |
* code für Arduino Mega 2560 | |
* Anschlüsse wie in https://youtu.be/xOhIc03cWW4 | |
* Peter Jung (2017) | |
* 2017-10-18 | |
*/ | |
int Kaefer1 = 13; | |
int Kaefer2 = 12; | |
int Balken = 11; | |
int Licht[] = { | |
38, 40, 42, 44, 46, 48, 50, 52, | |
39, 41, 43, 45, 47, 49, 51, 53 | |
}; | |
int Ton = 10; | |
void setup() { | |
pinMode(Kaefer1, OUTPUT); | |
pinMode(Kaefer2, OUTPUT); | |
pinMode(Balken, OUTPUT); | |
for(int i=0; i<16; i++){ | |
pinMode(Licht[i], OUTPUT); | |
} | |
pinMode(Ton, OUTPUT); | |
digitalWrite(Kaefer1, HIGH); | |
} | |
void loop() { | |
delay(5000); | |
digitalWrite(Kaefer2, HIGH); | |
delay(3000); | |
digitalWrite(Balken, HIGH); | |
delay(2000); | |
for(int i=0; i<16; i++){ | |
if (i==14){ | |
digitalWrite(Kaefer1, LOW); | |
delay(500); | |
digitalWrite(Kaefer1, HIGH); | |
delay(1500); | |
}else{ | |
if (i==15){ | |
digitalWrite(Kaefer2, LOW); | |
delay(500); | |
digitalWrite(Kaefer2, HIGH); | |
delay(1500); | |
}else{ | |
delay(2000); | |
} | |
} | |
digitalWrite(Licht[i], HIGH); | |
} | |
delay(8000); | |
digitalWrite(Balken, LOW); | |
for(int i=0; i<16; i++){ | |
digitalWrite(Licht[i], LOW); | |
} | |
digitalWrite(Ton, HIGH); | |
delay(12000); | |
digitalWrite(Kaefer2, LOW); | |
digitalWrite(Ton, LOW); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment