bLINK/Blink/Blink.ino
2019-12-29 21:28:55 +01:00

239 lines
4.1 KiB
C++

const int L = 3;
const int I = 5;
const int N = 4;
const int K = 6;
long randomTime;
void setup() {
pinMode(L, OUTPUT);
pinMode(I, OUTPUT);
pinMode(N, OUTPUT);
pinMode(K, OUTPUT);
}
void loop() {
singleOn(100);
}
void singleOn(int delayTime) {
digitalWrite(L, HIGH);
delay(delayTime);
digitalWrite(L, LOW);
digitalWrite(I, HIGH);
delay(delayTime);
digitalWrite(I, LOW);
digitalWrite(N, HIGH);
delay(delayTime);
digitalWrite(N, LOW);
digitalWrite(K, HIGH);
delay(delayTime);
digitalWrite(K, LOW);
}
void MiamiMidnight() {
digitalWrite(L, HIGH);
digitalWrite(I, HIGH);
digitalWrite(N, HIGH);
digitalWrite(K, HIGH);
randomTime = random(1000, 10000);
delay(randomTime);
digitalWrite(K, LOW);
delay(200);
digitalWrite(K, HIGH);
delay(400);
digitalWrite(I, LOW);
delay(200);
digitalWrite(I, HIGH);
delay(300);
digitalWrite(K, LOW);
delay(900);
}
void klinik() {
digitalWrite(K, HIGH);
delay(500);
digitalWrite(L, HIGH);
delay(100);
digitalWrite(K, LOW);
delay(400);
digitalWrite(I, HIGH);
delay(100);
digitalWrite(L, LOW);
delay(400);
digitalWrite(N, HIGH);
delay(100);
digitalWrite(I, LOW);
delay(400);
digitalWrite(I, HIGH);
delay(100);
digitalWrite(N, LOW);
delay(400);
digitalWrite(K, HIGH);
delay(100);
digitalWrite(I, LOW);
delay(400);
digitalWrite(K, LOW);
delay(1000);
}
void fromLeft() {
digitalWrite(L, HIGH);
delay(500);
digitalWrite(I, HIGH);
delay(100);
digitalWrite(L, LOW);
delay(400);
digitalWrite(N, HIGH);
delay(100);
digitalWrite(I, LOW);
delay(400);
digitalWrite(K, HIGH);
delay(100);
digitalWrite(N, LOW);
delay(900);
digitalWrite(L, HIGH);
delay(500);
digitalWrite(I, HIGH);
delay(100);
digitalWrite(L, LOW);
delay(400);
digitalWrite(N, HIGH);
delay(100);
digitalWrite(I, LOW);
delay(900);
digitalWrite(L, HIGH);
delay(500);
digitalWrite(I, HIGH);
delay(100);
digitalWrite(L, LOW);
delay(900);
digitalWrite(L, HIGH);
delay(3000);
}
void fromRight() {
digitalWrite(K, HIGH);
delay(500);
digitalWrite(N, HIGH);
delay(100);
digitalWrite(K, LOW);
delay(400);
digitalWrite(I, HIGH);
delay(100);
digitalWrite(N, LOW);
delay(400);
digitalWrite(L, HIGH);
delay(100);
digitalWrite(I, LOW);
delay(900);
digitalWrite(K, HIGH);
delay(500);
digitalWrite(N, HIGH);
delay(100);
digitalWrite(K, LOW);
delay(400);
digitalWrite(I, HIGH);
delay(100);
digitalWrite(N, LOW);
delay(900);
digitalWrite(K, HIGH);
delay(500);
digitalWrite(N, HIGH);
delay(100);
digitalWrite(K, LOW);
delay(900);
digitalWrite(K, HIGH);
delay(3000);
}
void toLeft() {
digitalWrite(L, HIGH);
digitalWrite(I, HIGH);
digitalWrite(N, HIGH);
digitalWrite(K, HIGH);
digitalWrite(L, LOW);
delay(1000);
digitalWrite(L, HIGH);
delay(100);
digitalWrite(I, LOW);
delay(400);
digitalWrite(L, LOW);
delay(1000);
digitalWrite(I, HIGH);
delay(100);
digitalWrite(N, LOW);
delay(400);
digitalWrite(L, HIGH);
delay(100);
digitalWrite(I, LOW);
delay(400);
digitalWrite(L, LOW);
delay(1000);
digitalWrite(N, HIGH);
delay(100);
digitalWrite(K, LOW);
delay(400);
digitalWrite(I, HIGH);
delay(100);
digitalWrite(N, LOW);
delay(400);
digitalWrite(L, HIGH);
delay(100);
digitalWrite(I, LOW);
delay(400);
digitalWrite(L, LOW);
delay(3000);
}
void toRight() {
digitalWrite(L, HIGH);
digitalWrite(I, HIGH);
digitalWrite(N, HIGH);
digitalWrite(K, HIGH);
digitalWrite(K, LOW);
delay(1000);
digitalWrite(K, HIGH);
delay(100);
digitalWrite(N, LOW);
delay(400);
digitalWrite(K, LOW);
delay(1000);
digitalWrite(N, HIGH);
delay(100);
digitalWrite(I, LOW);
delay(400);
digitalWrite(K, HIGH);
delay(100);
digitalWrite(N, LOW);
delay(400);
digitalWrite(K, LOW);
delay(1000);
digitalWrite(I, HIGH);
delay(100);
digitalWrite(L, LOW);
delay(400);
digitalWrite(N, HIGH);
delay(100);
digitalWrite(I, LOW);
delay(400);
digitalWrite(K, HIGH);
delay(100);
digitalWrite(N, LOW);
delay(400);
digitalWrite(K, LOW);
delay(3000);
}