/* Muellduino by joergeli Muellerinnerungskalender, Version fuer #### Nicht-Schaltjahre !!! ### Elektronischer Kalender, der am Vortag daran erinnert, dass am naechsten Tag Muell einer bestimmten Sorte abgeholt wird. Optische Anzeige sowohl in LCD-Display, als auch mittels aufblitzender LEDs. Hardware: 1 x Arduino Uno/Nano 1 x RTC DS3231 (Echtzeituhr) 3 x TLC5940 (LED-Driver, Multiplexer) 1 x LCD 1602 (Display) 43 x LED ________________________________________________________________________________________________ */ bool debug = false; // Zur Kontrolle: false = keine serielle Ausgabe, true = serielle Ausgabe bool startdisplay = true; // Startsequenz & LED-Test : false = nein, true = ja const char aktjahr[5] = "2015"; // Jahr, welches in der Startsequenz angezeigt wird //////////////////////////////////////////////////////////////////////////////////////////////// // Im nachfolgenden Kalender-Array *NUR* die entspr. Muellsorte am entspr. Datum eintragen // // Achtung: Sketch ist fuer Nicht-Schaltjahr, Array enthaelt also kein 29. Feb. ! // // Achtung: Struktur des Arrays nicht veraendern !!! // // Achtung: in der tlc_config.h die Anzahl der TLC5940 auf 3 setzen: #define NUM_TLCS 3 // //////////////////////////////////////////////////////////////////////////////////////////////// /* // Kind of waste: 1: Gelber Sack // "yellow sack" for packaging waste 2: Biomuell // organic waste 3: Restmuell // residual waste 4: Papier // paper 5: Biotonne & Papier // organic waste and paper are collected on the same day */ /* Set your own waste-calendar-variables in this section: */ const int abfallkalender[366]= { /* Datum: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 */ /* Jan */ 0, 0, 0, 0, 0, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, /* Feb */ 0, 0, 5, 0, 0, 0, 0, 0, 0, 4, 0, 0, 3, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, /* Mrz */ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 5, 4, /* Apr */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, /* Mai */ 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, /* Jun */ 0, 0, 0, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, /* Jul */ 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, /* Aug */ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, /* Sep */ 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, /* Okt */ 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, /* Nov */ 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, /* Dez */ 0, 2, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 4, 0, 0, 3, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, /*Dummy*/ 0 // wird benoetigt fuer Jahresuebergang }; ////////////////////////////////////////////////////////////////////////////////////////////77// // Ab hier bitte nichts mehr editieren ! ! ! Do not change anything after here !!!! ////////////////////////////////////////////////////////////////////////////////////////////77// // Date and time functions using a DS1307/DS3231 RTC connected via I2C and Wire lib //#include #include #include #include #include #include // Sonder-Zeichen fuer LCD byte ue[8] = { B01010, B00000, B10001, B10001, B10001, B10011, B01101 }; // Sonderzeichen ΓΌ fuer LCD byte pfeil[8] = { B00000, B00100, B00110, B11111, B00110, B00100, B00000 }; // Pfeil rechts fuer LCD byte mtlo[8] = { B00000, B00000, B00000, B00011, B00100, B11111, B01111 }; // Muelltonne links oben fuer LCD byte mtro[8] = { B00000, B00000, B00000, B10000, B01000, B11110, B11100 }; // Muelltonne rechts oben fuer LCD byte mtlu[8] = { B01001, B01000, B01010, B01000, B01001, B01000, B00111 }; // Muelltonne links unten fuer LCD byte mtru[8] = { B00100, B10100, B00100, B00100, B00100, B00100, B11000 }; // Muelltonne rechts unten fuer LCD //LCD-Belegung: //LCD pin name RS EN DB4 DB5 DB6 DB7 //LCD pin 4 6 11 12 13 14 //Arduino pin 2 4 5 6 7 8 LiquidCrystal lcd(2, 4, 5, 6, 7, 8); int zeitzone=1; // UTC=0 / MEZ=1 ,fuer Sommerzeitroutine int summertime; // fuer Sommerzeitroutine int schaltjahr; // 0 oder 1 int stunde; int minut; int sekunde; int jar; int muelli; short DN; //(D)ay(N)umber = Tag des Jahres short WN; //(W)eek(N)umber = Wochennummer (Kalenderwoche) short datum; short monat; short muelldatum; short muellmonat; int days[12]; int muellart; // Muellart als Zahl int wochentag; // Wochentag als Zahl char* mkurz; // Muelltag Kurzform char* wkurz; char sonn[3] = {"So"}; char mont[3] = {"Mo"}; char dien[3] = {"Di"}; char mitt[3] = {"Mi"}; char donn[3] = {"Do"}; char frei[3] = {"Fr"}; char sams[3] = {"Sa"}; char* wlang; char sonntag[11] = {"Sonntag"}; char montag[11] = {"Montag"}; char dienstag[11] = {"Dienstag"}; char mittwoch[11] = {"Mittwoch"}; char donnerstag[11] = {"Donnerstag"}; char freitag[11] = {"Freitag"}; char samstag[11] = {"Samstag"}; //_______________________________________________________________________________________________ void setup () { lcd.createChar(0, ue); //Zeichen ue fuer Display lcd.createChar(1, pfeil); //Zeichen -> fuer Display lcd.createChar(2, mtlo); //Muelltone lo fuer Display lcd.createChar(3, mtro); //Muelltone ro fuer Display lcd.createChar(4, mtlu); //Muelltone lu fuer Display lcd.createChar(5, mtru); //Muelltone ru fuer Display lcd.begin(16, 2); // LCD-Display mit 16 Spalten, 2 Reihen. Tlc.init(); Tlc.clear(); if (startdisplay){ intro(); // Startanzeige auf Display led_test(); // LED's werden nach Intro zeilen- und spaltenweise durchlaufen } lcd.clear(); delay (900); if (debug){ Serial.begin(9600); } #ifdef AVR Wire.begin(); #else Wire1.begin(); // Shield I2C pins connect to alt I2C bus on Arduino Due #endif } // Ende Setup //_______________________________________________________________________________________________ void loop () { setSyncProvider(RTC.get); // Funktion, um die Zeit von der DS3231-RTC zu holen stunde = hour(); minut = minute(); sekunde = second(); jar = year(); wochentag = weekday(); // bei Time-library ist Sonntag = 0 DayWeekNumber(year(),month(),day(),weekday()); // Tag des Jahres (DN) und Kalenderwoche (WN) ermitteln sommerzeit(); // auf Sommerzeit pruefen // Wochentag als Text switch (wochentag) { case 1: wkurz= sonn; wlang= sonntag; break; case 2: wkurz= mont; wlang= montag; break; case 3: wkurz= dien; wlang= dienstag; break; case 4: wkurz= mitt; wlang= mittwoch; break; case 5: wkurz= donn; wlang= donnerstag; break; case 6: wkurz= frei; wlang= freitag; break; case 7: wkurz= sams; wlang= samstag; break; } // Ende switch wochentag // LED-Anzeigen Tlc.clear(); Tlc.set(day()-1 , 1800); // "heute"-LED leuchten lassen Tlc.set((month()-1)+31 , 1800); // Monats-LED leuchten lassen //Tlc.set((wochentag-1)+43 , 1800); // Wochentag-LED leuchten lassen (sind hardwaremaessig nicht vorhanden) Tlc.update(); /* Array Tag des Jahres: ______________________________________ Array-Position --> Tag im Nicht-Schaltjahr ______________________________________ 0-30 1-31 = 1-31 Jan 31-58 32-59 = 1-28 Feb 59-89 60-90 = 1-31 Mrz 90-119 91-120 = 1-30 Apr 120-150 121-151 = 1-31 Mai 151-180 152-181 = 1-30 Jun 181-211 182-212 = 1-31 Jul 212-242 213-243 = 1-31 Aug 243-272 244-273 = 1-30 Sep 273-303 274-304 = 1-31 Okt 304-333 305-334 = 1-30 Nov 334-364 335-365 = 1-31 Dez */ // Werte und Anzeigen gem. Tag des Jahres (DN) generieren //__Januar__________________________________________________________________________________________________________ if (DN>=1 && DN<=30) { datum=(DN); muelldatum=(datum+1); monat=1; muellmonat=monat; muellflash(monat, DN); } //1-30 Jan else if (DN==31) { datum=31; muelldatum=1; monat=1; muellmonat=monat+1; muellflash(monat, DN); } // 31. Jan //__Februar_________________________________________________________________________________________________________ else if (DN>=32 && DN<=58) { datum=(DN-31); muelldatum=(datum+1); monat=2; muellmonat=monat; muellflash(monat, DN); } //1-27 Feb else if (DN==59) { datum=28; muelldatum=1; monat=2; muellmonat=monat+1; muellflash(monat, DN); } // 28. Feb //__Maerz___________________________________________________________________________________________________________ else if (DN>=60 && DN<=89) { datum=(DN-59); muelldatum=(datum+1); monat=3; muellmonat=monat; muellflash(monat, DN); } //1-30 Mrz else if (DN==90) { datum=31; muelldatum=1; monat=3; muellmonat=monat+1; muellflash(monat, DN); } // 31. Mrz //__April___________________________________________________________________________________________________________ else if (DN>=91 && DN<=119) { datum=(DN-90); muelldatum=(datum+1); monat=4; muellmonat=monat; muellflash(monat, DN); } //1-29 Apr else if (DN==120) { datum=30; muelldatum=1; monat=4; muellmonat=monat+1; muellflash(monat, DN); } // 30. Apr //__Mai___________________________________________________________________________________________________________ else if (DN>=121 && DN<=150){ datum=(DN-120); muelldatum=(datum+1); monat=5; muellmonat=monat; muellflash(monat, DN); } //1-30 Mai else if (DN==151) { datum=31; muelldatum=1; monat=5; muellmonat=monat+1; muellflash(monat, DN); } // 31. Mai //__Juni___________________________________________________________________________________________________________ else if (DN>=152 && DN<=180){ datum=(DN-151); muelldatum=(datum+1); monat=6; muellmonat=monat; muellflash(monat, DN); } //1-29 Juni else if (DN==181) { datum=30; muelldatum=1; monat=6; muellmonat=monat+1; muellflash(monat, DN); } // 30. Juni //__Juli___________________________________________________________________________________________________________ else if (DN>=182 && DN<=211){ datum=(DN-181); muelldatum=(datum+1); monat=7; muellmonat=monat; muellflash(monat, DN); } //1-30 Juli else if (DN==212) { datum=31; muelldatum=1; monat=7; muellmonat=monat+1; muellflash(monat, DN); } // 31. Juli //__August___________________________________________________________________________________________________________ else if (DN>=213 && DN<=242){ datum=(DN-212); muelldatum=(datum+1); monat=8; muellmonat=monat; muellflash(monat, DN); } //1-30 August else if (DN==243) { datum=31; muelldatum=1; monat=8; muellmonat=monat+1; muellflash(monat, DN); } // 31. August //__September___________________________________________________________________________________________________________ else if (DN>=244 && DN<=272){ datum=(DN-243); muelldatum=(datum+1); monat=9; muellmonat=monat; muellflash(monat, DN); } //1-29 September else if (DN==273) { datum=30; muelldatum=1; monat=9; muellmonat=monat+1; muellflash(monat, DN); } // 30. September //__Oktober___________________________________________________________________________________________________________ else if (DN>=274 && DN<=303){ datum=(DN-273); muelldatum=(datum+1); monat=10; muellmonat=monat; muellflash(monat, DN); } //1-30 Oktober else if (DN==304) { datum=31; muelldatum=1; monat=10; muellmonat=monat+1; muellflash(monat, DN); } // 31. Oktober //__November___________________________________________________________________________________________________________ else if (DN>=305 && DN<=333){ datum=(DN-304); muelldatum=(datum+1); monat=11; muellmonat=monat; muellflash(monat, DN); } //1-29 November else if (DN==334) { datum=30; muelldatum=1; monat=11; muellmonat=monat+1; muellflash(monat, DN); } // 30. November //__Dezember___________________________________________________________________________________________________________ else if (DN>=335 && DN<=364){ datum=(DN-334); muelldatum=(datum+1); monat=12; muellmonat=monat; muellflash(monat, DN); } //1-30 Dezember else if (DN==365) { datum=31; muelldatum=1; monat=12; muellmonat=1; muellflash(monat, DN); } // 31. Dezember if(stunde==0 && summertime==1) { datum = datum + 1; wochentag = wochentag + 1;} // wenn Sommerzeit, zwischen 00:00 und 01:00 Uhr Datum und Wochentag um 1 erhoehen if (debug){ seriellausg(); } // nur zum Debuggen // Aktuelles Datum und Wochentag auf LCD anzeigen lcd.setCursor(0,0); // 1. Zeile if (day()<10) {lcd.print("0"); } lcd.print(datum); lcd.print("."); if (month()<10) {lcd.print("0"); } lcd.print(monat); lcd.print("."); lcd.print(jar); lcd.print(" "); if(stunde<10){ lcd.print("0"); } lcd.print(stunde); // blinkender Doppelpunkt lcd.setCursor(13,0); lcd.print(" "); delay(150); lcd.setCursor(13,0); lcd.print(":"); if(minut<10){ lcd.print("0"); } lcd.print(minut); // 2. Zeile lcd.setCursor(0,1); lcd.print(" "); // 2. Zeile kpl. ueberschreiben lcd.setCursor(0,1); lcd.print(wlang); // Wochentag in Langform lcd.setCursor(11,1); lcd.print("KW "); if(WN<10){ lcd.print("0"); } lcd.print(WN); // Kalenderwoche // wenn Muell am naechsten Tag if(muellart != 0){ for( int i=150; i<=1800; i++){ Tlc.set(day()-1 , i); // "heute"-LED langsam aufhellen Tlc.set((month()-1)+31 , i); // "monats"-LED langsam aufhellen Tlc.update(); delay(1); } } // wenn kein Muell am naechsten Tag if(muellart == 0){ for( int i=1800; i>=150; i--){ Tlc.set(day()-1 , i); // "heute"-LED langsam abdunkeln Tlc.set((month()-1)+31 , i); // "monats"-LED langsam abdunkeln Tlc.update(); delay(1); } for( int i=150; i<=1800; i++){ Tlc.set(day()-1 , i); // "heute"-LED langsam aufhellen Tlc.set((month()-1)+31 , i); // "monats"-LED langsam aufhellen Tlc.update(); delay(1); } } } // Ende loop //_______________________________________________________________________________________________ /* Array Tag des Jahres: ______________________________________ Array-Position --> Tag im Nicht-Schaltjahr ______________________________________ 0-30 1-31 = 1-31 Jan 31-58 32-59 = 1-28 Feb 59-89 60-90 = 1-31 Mrz 90-119 91-120 = 1-30 Apr 120-150 121-151 = 1-31 Mai 151-180 152-181 = 1-30 Jun 181-211 182-212 = 1-31 Jul 212-242 213-243 = 1-31 Aug 243-272 244-273 = 1-30 Sep 273-303 274-304 = 1-31 Okt 304-333 305-334 = 1-30 Nov 334-364 335-365 = 1-31 Dez */ // Funktion, um Tag des Jahres zu bestimmen int DayWeekNumber(unsigned int y, unsigned int m, unsigned int d, unsigned int w){ int days[]={0,31,59,90,120,151,181,212,243,273,304,334}; // Tag des Jahres am Monatsanfang, wenn *KEIN* Schaltjahr. // Pruefung auf Schaltjahr if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0){schaltjahr = 1;} else {schaltjahr = 0;} //Anzahl der Tage ab 1. Januar berechnen: DN = days[(m-1)]+d; // Kalenderwoche berechnen w = w-1; // Wochentag um 1 subtrahieren, weil bei time-library Sonntag = 0 if (w==0) { WN = (DN-7+10)/7; } // ... wenn Sonntag ist else { WN = (DN-w+10)/7; } // ... fuer die anderen Wochentage w = w+1; // Wochentag wieder um 1 erhoehen return schaltjahr; // nur fuer Anzeige bei debug } //Ende DayWeekNumber //_______________________________________________________________________________________________ // pruefen, ob akt Datum innerhalb von Sommerzeit ist void sommerzeit() { // keine Sommerzeit im Jan, Feb, Nov, Dez if (month()<3 || month()>10){summertime = 0;} // Sommerzeit im Apr, Mai, Jun, Jul, Aug, Sep else if (month()>3 && month()<10){summertime = 1;} // Sommerzeitumstellung Ende Maerz, bzw. Ende Oktober else if ( month()==3 && (hour() + 24 * day())>=(1 + zeitzone + 24*(31 - (5 * year() /4 + 4) % 7)) || month()==10 && (hour() + 24 * day())< (1 + zeitzone + 24*(31 - (5 * year() /4 + 1) % 7)) ) {summertime = 1;} else {summertime = 0;} stunde = stunde + summertime; if(stunde==24) { stunde=0; } // if(stunde==0 && summertime==1) { datum = datum + 1; wochentag = wochentag + 1; } } // Ende sommerzeit //_______________________________________________________________________________________________ // Pruefen, ob morgen Muell abgeholt wird. Wenn ja, entspr. auf LCD anzeigen und LED's aufblitzen lassen int muellflash(int monat, int DN){ muelli=(abfallkalender[DN]); // Muell am naechsten Tag if (datum == day() && monat == month() && muelli > 0){ muellart = muelli; // muellart fuer den naechsten!!!! Tag lcdanz(); muellblitz(); } else{ muellart = 0; } if(debug){ Serial.println(); Serial.print("Muellart: "); Serial.print(muellart); Serial.println(); } return muellart; } // Ende muellflash //_______________________________________________________________________________________________ // LED fuer morgen aufblitzen lassen void muellblitz(){ for ( int b=0; b<=3; b++){ Tlc.set(muelldatum-1, 3000); //muelldatum-LED aufhellen Tlc.set((muellmonat-1)+31, 3000); //muellmonat-LED aufhellen Tlc.update(); delay (150); Tlc.set(muelldatum-1, 0); //muelldatum-LED abdunkeln Tlc.set((muellmonat-1)+31, 0); //muellmonat-LED abdunkeln Tlc.update(); delay (90); } delay(500); } // Ende muellblitz // LED zum zweiten Mal fuer morgen aufblitzen lassen, wenn 2 mal Muell void muellblitz_2(){ for ( int b=0; b<=3; b++){ Tlc.set(muelldatum-1, 3000); //muelldatum-LED aufhellen Tlc.set((muellmonat-1)+31, 3000); //muellmonat-LED aufhellen Tlc.update(); delay (150); Tlc.set(muelldatum-1, 0); //muelldatum-LED abdunkeln Tlc.set((muellmonat-1)+31, 0); //muellmonat-LED aufhellen Tlc.update(); delay (90); } delay(500); } // Ende muellblitz_2 //_______________________________________________________________________________________________ // Muelldaten auf LCD anzeigen int lcdanz(){ // Muelltag als Text switch (wochentag+1) { //case 1: mkurz="So"; break; case 2: mkurz= mont; break; case 3: mkurz= dien; break; case 4: mkurz= mitt; break; case 5: mkurz= donn; break; case 6: mkurz= frei; break; case 7: mkurz= sams; break; case 8: mkurz= sonn; break; } // Ende switch muelltag Tlc.set(day()-1 , 150); // "heute"-LED abdunkeln Tlc.set((month()-1)+31 , 150); // "monats"-LED abdunkeln Tlc.update(); lcd.setCursor(0,0); lcd.print(" "); // 1. Zeile kpl. ueberschreiben lcd.setCursor(0,0); if (muelldatum <10) {lcd.print("0"); } lcd.print(muelldatum); lcd.print("."); if (muellmonat <10) {lcd.print("0"); } lcd.print(muellmonat); lcd.print("."); lcd.print(year()); lcd.print(" -"); lcd.write(byte(1)); lcd.print(" "); lcd.print(mkurz); lcd.setCursor(0,1); lcd.print(" "); // 2. Zeile kpl. ueberschreiben lcd.setCursor(3,1); /* // Muellsorte: 1: Gelber Sack 2: Biotonne 3: Restmuell 4: Papiertonne 5: Biotonne & Papiertonne */ // 1: Gelber Sack if (muellart == 1){ lcd.print("Gelber Sack"); } // 2: Biotonne if (muellart == 2){ lcd.print("Biotonne"); } // 3: Restmuell if (muellart == 3){ lcd.print(" Restm"); lcd.write(byte(0)); lcd.print("ll"); } // 4: Papier if (muellart == 4){ lcd.print("Papiertonne"); } // 5: Biotonne & Papiertonne if (muellart == 5){ lcd.print("Biotonne"); lcd.print(" &"); muellblitz_2(); delay (100); lcd.setCursor(3,1); lcd.print("Papiertonne"); } return muellart; } // Ende lcdanz //_______________________________________________________________________________________________ void led_test() { int verzt = 60; int verzm = 130; int verzts = 80; Tlc.clear(); // Tages-Reihe 1 for (int channel=0; channel <=6; channel ++){ Tlc.set(channel, 2600); Tlc.update(); delay (verzt); } for (int channel=0; channel <=6; channel ++){ Tlc.set(channel, 0); Tlc.update(); delay (verzt); } // Tages-Reihe 2 for (int channel=13; channel >=7; channel --){ Tlc.set(channel, 2600); Tlc.update(); delay (verzt); } for (int channel=13; channel >=7; channel --){ Tlc.set(channel, 0); Tlc.update(); delay (verzt); } // Tages-Reihe 3 for (int channel=14; channel <=20; channel ++){ Tlc.set(channel, 2600); Tlc.update(); delay (verzt); } for (int channel=14; channel <=20; channel ++){ Tlc.set(channel, 0); Tlc.update(); delay (verzt); } // Tages-Reihe 4 for (int channel=27; channel >=21; channel --){ Tlc.set(channel, 2600); Tlc.update(); delay (verzt); } for (int channel=27; channel >=21; channel --){ Tlc.set(channel, 0); Tlc.update(); delay (verzt); } // Tages-Reihe 5 for (int channel=28; channel <=30; channel ++){ Tlc.set(channel, 2600); Tlc.update(); delay (verzt); } for (int channel=28; channel <=30; channel ++){ Tlc.set(channel, 0); Tlc.update(); delay (verzt); } Tlc.clear(); delay (250); // Monatsspalten vorwaerts for (int channel=31; channel <=39; channel +=4){ Tlc.set(channel, 2600); Tlc.update(); delay (verzm); } for (int channel=40; channel >=32; channel -=4){ Tlc.set(channel, 2600); Tlc.update(); delay (verzm); } for (int channel=33; channel <=41; channel +=4){ Tlc.set(channel, 2600); Tlc.update(); delay (verzm); } for (int channel=42; channel >=34; channel -=4){ Tlc.set(channel, 2600); Tlc.update(); delay (verzm); } // Monatsspalten rueckwaerts for (int channel=42; channel >=34; channel -=4){ Tlc.set(channel, 0); Tlc.update(); delay (verzm); } for (int channel=33; channel <=41; channel +=4){ Tlc.set(channel, 0); Tlc.update(); delay (verzm); } for (int channel=40; channel >=32; channel -=4){ Tlc.set(channel, 0); Tlc.update(); delay (verzm); } for (int channel=31; channel <=39; channel +=4){ Tlc.set(channel, 0); Tlc.update(); delay (verzm); } delay (250); // Tagessspalten for (int channel=28; channel >=0; channel -=7){ Tlc.set(channel, 2600); Tlc.update(); delay (verzts); } for (int channel=28; channel >=0; channel -=7){ Tlc.set(channel, 0 ); Tlc.update(); delay (verzts); } for (int channel=1; channel <=29; channel +=7){ Tlc.set(channel, 2600); Tlc.update(); delay (verzts); } for (int channel=1; channel <=29; channel +=7){ Tlc.set(channel, 0 ); Tlc.update(); delay (verzts); } for (int channel=30; channel >=2; channel -=7){ Tlc.set(channel, 2600); Tlc.update(); delay (verzts); } for (int channel=30; channel >=2; channel -=7){ Tlc.set(channel, 0 ); Tlc.update(); delay (verzts); } for (int channel=3; channel <=24; channel +=7){ Tlc.set(channel, 2600); Tlc.update(); delay (verzts); } for (int channel=3; channel <=24; channel +=7){ Tlc.set(channel, 0 ); Tlc.update(); delay (verzts); } for (int channel=25; channel >=4; channel -=7){ Tlc.set(channel, 2600); Tlc.update(); delay (verzts); } for (int channel=25; channel >=4; channel -=7){ Tlc.set(channel, 0 ); Tlc.update(); delay (verzts); } for (int channel=5; channel <=26; channel +=7){ Tlc.set(channel, 2600); Tlc.update(); delay (verzts); } for (int channel=5; channel <=26; channel +=7){ Tlc.set(channel, 0 ); Tlc.update(); delay (verzts); } for (int channel=27; channel >=6; channel -=7){ Tlc.set(channel, 2600); Tlc.update(); delay (verzts); } for (int channel=27; channel >=6; channel -=7){ Tlc.set(channel, 0 ); Tlc.update(); delay (verzts); } } // Ende led_test //_______________________________________________________________________________________________ // Introsequenz - Startdisplay void intro(){ lcd.clear(); delay(500); lcd.print(" M"); lcd.write(byte(0)); lcd.print("llduino"); lcd.setCursor(14,0); lcd.write(byte(2)); lcd.write(byte(3)); lcd.setCursor(14,1); lcd.write(byte(4)); lcd.write(byte(5)); delay(1500); lcd.setCursor(0,1); lcd.print(" by joergeli"); delay(3000); lcd.clear(); lcd.print(" Abfall-Kalender"); delay(1000); lcd.setCursor(0,1); lcd.print(" f"); lcd.write(byte(0)); lcd.print("r "); lcd.print(aktjahr); delay(3000); lcd.clear(); lcd.print(" LED-Test"); delay(100); lcd.setCursor(0,1); lcd.print(" ........"); delay(500); }// Ende Intro //_______________________________________________________________________________________________ // Serielle Ausgabe zum Debuggen void seriellausg(){ Serial.print("Sommerzeit: "); if(summertime == 0) { Serial.println("nein"); } else if(summertime == 1) { Serial.println("ja"); } Serial.print("RTC-Zeit: "); Serial.print(hour()); Serial.print(":"); Serial.print(minute()); Serial.print(":"); Serial.print(second()); Serial.print(" "); Serial.print(day()); Serial.print("."); Serial.print(month()); Serial.print("."); Serial.println(year()); if(datum < 10) { Serial.print('0'); } Serial.print(datum); Serial.print("."); if(monat < 10) { Serial.print('0'); } Serial.print(monat); Serial.print("."); Serial.print(jar); Serial.print(" "); if(stunde < 10) { Serial.print('0'); } Serial.print(stunde); Serial.print(":"); if(minut < 10) { Serial.print('0'); } Serial.print(minut); Serial.print(":"); if(sekunde < 10) { Serial.print('0'); } Serial.print(sekunde); Serial.print(" / Tag "); Serial.print(DN); Serial.print(" in Woche "); Serial.print(WN); Serial.print("/"); Serial.println(jar); Serial.print("Wochentag: "); Serial.print(wochentag); Serial.print(" / "); Serial.print(wlang); Serial.print(" Schaltjahr: "); Serial.println(schaltjahr); Serial.println("_____________________________________"); Serial.println(""); } // Ende seriellausg //_______________________________________________________________________________________________