Ok, hier ist der Sketch:
/*Leuchttürme:
0 1 gr. Leuchtturm Borkum 1 Taktung: Fl (2) 12s
1 2 Fischerbalje 4 Taktung: Oc (2) 16s
2 3 Juister Memmertfeuer Taktung: Oc (2) 14s
3 4 Campen Taktung: Fl 5s, Fl(4) 15s
4 8 Norderney-Seefeuer Taktung: Fl (3) 12s
5 9 Helgoland Taktung: Fl 5s w
6 10 Helgoland-Düne Taktung: Iso 4s
7 11 Wooge neuer LT 2 Taktung: Fl 5s r
8 13 Arngast Taktung: Fl (2) 9s/Ubr. 6s
9 14 Tegeler Plate Taktung: Oc (3) 12s
10 16 Robbenplate Taktung: Oc 6s
11 17 Kleiner Preuße Taktung: Iso 5s
12 19 Neuwerk Taktung: LFl (3) 20s
13 20 Großerpater Taktung: Iso 4s
14 22 BHV Unterfeuer Minarett 2 Taktung: Iso 4s
15 23 BHV Oberfeuer Loschenturm 3 Taktung: Iso 4s
Wracks, Untiefen, Hindernisse etc.: weißes Licht
16 3x Juisterriff und Norderney N; 2x Helgoländer Bucht SZ-n, Düne-N; 3x Nordergründe,Scharnhörnriff und Westertill N; 1x Buhne 3 N: Fkl
17 2x Helgoland, Scharnhörnriff-W: Fkl (9) 15s
18 2x Helgoland und Düne-O: Fkl (3) 10s
19 2x Düne und Robinsbalje-S: Fkl (6) + Blk 15s
20 7x Reede Steingrund und Außenelbe: Fl, gelb
Fahrwassermarkierungen: rotes Licht
21 Osterems, Dovetief, Otzumer Balje, Norderelbe, Helgoländer Bucht E3: Iso 4s, r
22 Schluchter, Accumer Ee, Harle, Schlüsseltonne, Süderpiep, Helgoländer Bucht E2: Iso 8s, r
23 Elbe: Iso 10s, r
24 Jade-Weser: Oc 4s, r
*/
#include <MsTimer2.h>
uint8_t setOutput(uint8_t pin) {
pinMode(pin, OUTPUT);
return 0;
}
template <uint8_t led, uint32_t d1, uint32_t d2, uint32_t d3, uint32_t d4,
uint32_t d5, uint32_t d6, uint32_t d7, uint32_t d8,
uint32_t d9, uint32_t d10, uint32_t d11, uint32_t d12,
uint32_t d13, uint32_t d14, uint32_t d15, uint32_t d16,
uint32_t d17, uint32_t d18>
void light_my_fire() {
static uint32_t phase = setOutput(led);
phase = phase < d1+d2+d3+d4+d5+d6+d7+d8+d9+d10+d11+d12+d13+d14+d15+d16+d17+d18-1? phase+1: 0;
digitalWrite(led, phase < d1 ? HIGH:
phase < d1+d2 ? LOW:
phase < d1+d2+d3 ? HIGH:
phase < d1+d2+d3+d4 ? LOW:
phase < d1+d2+d3+d4+d5 ? HIGH:
phase < d1+d2+d3+d4+d5+d6 ? LOW:
phase < d1+d2+d3+d4+d5+d6+d7 ? HIGH:
phase < d1+d2+d3+d4+d5+d6+d7+d8 ? LOW:
phase < d1+d2+d3+d4+d5+d6+d7+d8+d9 ? HIGH:
phase < d1+d2+d3+d4+d5+d6+d7+d8+d9+d10 ? LOW:
phase < d1+d2+d3+d4+d5+d6+d7+d8+d9+d10+d11 ? HIGH:
phase < d1+d2+d3+d4+d5+d6+d7+d8+d9+d10+d11+d12 ? LOW:
phase < d1+d2+d3+d4+d5+d6+d7+d8+d9+d10+d11+d12+d13 ? HIGH:
phase < d1+d2+d3+d4+d5+d6+d7+d8+d9+d10+d11+d12+d13+d14 ? LOW:
phase < d1+d2+d3+d4+d5+d6+d7+d8+d9+d10+d11+d12+d13+d14+d15 ? HIGH:
phase < d1+d2+d3+d4+d5+d6+d7+d8+d9+d10+d11+d12+d13+d14+d15+d16 ? LOW:
phase < d1+d2+d3+d4+d5+d6+d7+d8+d9+d10+d11+d12+d13+d14+d15+d16+d17 ? HIGH:
LOW);
}
// Schaltfolge: LED ein aus ein aus ein aus ein aus ein aus ein aus ein aus ein aus ein aus
void blink() {
light_my_fire< 0, 200, 2800, 200, 8800, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // gr. LT Borkum Fl (2) 12s
light_my_fire< 1, 0, 1000, 5000, 1000, 9000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // Fischerbalje 4 Oc (2) 16s
light_my_fire< 2, 0, 1000, 4000, 1000, 8000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // Juister Memmertfeuer Oc (2) 14s
light_my_fire< 3, 700, 2300, 700, 2300, 700, 2300, 700, 5300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // Campen Fl(4) 15s
light_my_fire< 4, 200, 2800, 200, 2800, 200, 5800, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // Norderney Fl (3) 12s
light_my_fire< 5, 400, 4600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // Helgoland Fl 5s
light_my_fire< 6, 2000, 2000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // Helgoland-Düne Iso 4s
light_my_fire< 7, 400, 4600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // Wooge neuer LT Fl 5s, r
light_my_fire< 8, 200, 2800, 200, 7800, 4000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // Arngast Fl (2) 9s/Ubr. 6s
light_my_fire< 9, 0, 1000, 2000, 1000, 2000, 1000, 5000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // Tegeler Plate Oc (3) 12s
light_my_fire<10, 0, 2000, 4000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // Robbenplate Oc 6s
light_my_fire<11, 2500, 2500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // Kleiner Preuße Iso 5s
light_my_fire<12, 2000, 4000, 2000, 4000, 2000, 6000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // Neuwerk LFl (3) 20s
light_my_fire<13, 2000, 2000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // Großpater Iso 4s
light_my_fire<14, 2000, 2000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // BHV Unterfeuer Minarett 2 Iso 4s
light_my_fire<15, 2000, 2000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // BHV Oberfeuer Loschenturm 3 Iso 4s
light_my_fire<16, 500, 500, 500, 500, 500, 500, 500, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // 3x Juisterriff und Norderney N; 2x Helgoländer Bucht SZ-n, Düne-N; 3x Nordergründe,Scharnhörnriff und Westertill N; 1x Buhne 3 N: Fkl, w
light_my_fire<17, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 65000>(); // 2x Helgoland, Scharnhörnriff-W: Fkl (9) 15s, w
light_my_fire<18, 500, 500, 500, 500, 500, 7500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // 2x Helgoland und Düne-O: Fkl (3) 10s, w
light_my_fire<19, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 2500, 3000, 4000, 0, 0, 0, 0>(); // 2x Düne und Robinsbalje-S: Fkl (6) + Blk 15s, w
light_my_fire<20, 500, 7500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // 7x Reede Steingrund und Außenelbe: Fl, gelb
light_my_fire<21, 2000, 2000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // Osterems, Dovetief, Otzumer Balje, Norderelbe, Helgoländer Bucht E3: Iso 4s, r
light_my_fire<22, 4000, 4000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // Schluchter, Accumer Ee, Harle, Schlüsseltonne, Süderpiep, Helgoländer Bucht E2: Iso 8s, r
light_my_fire<23, 5000, 5000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // Elbe: Iso 10s, r
light_my_fire<24, 0, 1000, 3000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>(); // Jade-Weser: Oc 4s, r
}
void setup() {
MsTimer2::set(1, blink);
MsTimer2::start();
}
void loop() {
}
Anliegend der prinzipielle Steckbrettaufbau: Schaltplan LED für Sehkarte...pdf
und ein Foto mit dem gleichen Aufbau am Processor Arduino.328 in Funktion
Schaltplan Leuchtturmdioden für Sehkarte_Steckplatine.pdf (1.22 MB)