LPC1768 programm for the led matrix.
Dependencies: BufferedSerial DS3231 mbed-rtos mbed
Revision 3:bd1352d4dbb8, committed 2018-01-17
- Comitter:
- JOEV
- Date:
- Wed Jan 17 07:12:35 2018 +0000
- Parent:
- 2:d5472e4a55bf
- Commit message:
- first release -> not everything has been commented yet but should work
Changed in this revision
diff -r d5472e4a55bf -r bd1352d4dbb8 BufferedSerial.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BufferedSerial.lib Wed Jan 17 07:12:35 2018 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/sam_grove/code/BufferedSerial/#a0d37088b405
diff -r d5472e4a55bf -r bd1352d4dbb8 DS3231.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DS3231.lib Wed Jan 17 07:12:35 2018 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/cromda/code/DS3231/#6718c4fabf95
diff -r d5472e4a55bf -r bd1352d4dbb8 alphabet.h --- a/alphabet.h Wed Oct 12 13:22:19 2016 +0000 +++ b/alphabet.h Wed Jan 17 07:12:35 2018 +0000 @@ -31,13 +31,13 @@ T[] = {0x40,0x40,0x7F,0x40,0x40}, t[] = {0x10,0x7F,0x10}, // T t U[] = {0x7E,0x01,0x01,0x7E}, u[] = {0x1E,0x01,0x01,0x01,0x1F}, // U u V[] = {0x7C,0x02,0x01,0x02,0x7C}, v[] = {0x18,0x06,0x01,0x06,0x18}, // V v - W[] = {0x7F,0x06,0x0C,0x06,0x7F}, w[] = {0x0E,0x01,0x02,0x01,0x0E}, // W w + W[] = {0x7F,0x06,0x0C,0x06,0x7F}, w[] = {0x1E,0x01,0x02,0x01,0x1E}, // W w X[] = {0x77,0x08,0x08,0x77}, x[] = {0x1B,0x04,0x04,0x1B}, // X x Y[] = {0x70,0x08,0x07,0x08,0x70}, y[] = {0x18,0x05,0x02,0x04,0x18}, // Y y Z[] = {0x43,0x4D,0x51,0x61}, z[] = {0x13,0x15,0x15,0x19}, // Z z // Numbers - zero[] = {0x3E,0x49,0x51,0x3E}, // 0 - one[] = {0x21,0x7F,0x01}, // 1 + zero[] = {0x3E,0x41,0x41,0x3E}, // 0 + one[] = {0x00,0x21,0x7F,0x01}, // 1 two[] = {0x23,0x45,0x49,0x31}, // 2 three[] = {0x22,0x41,0x49,0x36}, // 3 four[] = {0x7C,0x04,0x7F,0x04}, // 4 @@ -50,12 +50,12 @@ exclam[] = {0x7D}, quest[] = {0x60,0x4D,0x70}, // ! ? quote[] = {0xC0,0x00,0xC0}, hash[] = {0x14,0x3E,0x14,0x3E,0x14}, // " # dollar[] = {0x12,0x22,0x7F,0x2A,0x24}, // $ - prcent[] = {0x22,0x54,0x54,0x2A,0x15,0x15,0x22}, // % + prcent[] = {0x22,0x54,0x24,0x08,0x12,0x15,0x22}, // % _and[] = {0x36,0x49,0x35,0x02,0x05}, // & apost[] = {0xC0}, round_o[] = {0x3E,0x41}, // ' ( round_c[] = {0x41,0x3E}, star[] = {0x2A,0x1C,0x3E,0x1C,0x2A}, // ) * plus[] = {0x08,0x08,0x3E,0x08,0x08}, // + - minus[] = {0x08,0x08,0x08}, _equal[] = {0x14,0x14,0x14}, // - = + minus[] = {0x08,0x08,0x08}, _equal[] = {0x14,0x14,0x14,0x14}, // - = comma[] = {0x01,0x06}, point[] = {0x01}, // , . slash[] = {0x01,0x06,0x08,0x30,0x40}, d_point[] = {0x14}, // / : poicom[] = {0x01,0x16}, undlin[] = {0x01,0x01,0x01,0x01}, // ; _ @@ -65,8 +65,9 @@ roof[] = {0x20,0x40,0x20}, brace_o[] = {0x08,0x36,0x41}, // ^ { brace_c[] = {0x41,0x36,0x08}, wave[] = {0x08,0x10,0x08,0x10}, // } ~ stick[] = {0xff}, frapo[] = {0x80,0x40}, // | ` - space[] = {0x00,0x00,0x00}, // Leerschlag - betLet[] = {0x00} // Abstand zwischen Buchstaben -; + space[] = {0x00,0x00,0x00}, // Leerschlag + betLet[] = {0x00}, // Abstand zwischen Buchstaben + errorText[] = {0x55,0xCC,0x55,0xCC} + ; //------------------------- #endif \ No newline at end of file
diff -r d5472e4a55bf -r bd1352d4dbb8 initalize.h --- a/initalize.h Wed Oct 12 13:22:19 2016 +0000 +++ b/initalize.h Wed Jan 17 07:12:35 2018 +0000 @@ -1,26 +1,39 @@ #ifndef INITALIZE_H #define INITALIZE_H + +#include "rtos.h" +#include <BufferedSerial.h> +#include "DS3231.h" #include <string> #include "mbed.h" -//------------------------------------------------------------------------------------------------------ -/* - ___ _ _ - | __| _ _ _ __| |_(_)___ _ _ ___ - | _| || | ' \/ _| _| / _ \ ' \(_-< - |_| \_,_|_||_\__|\__|_\___/_||_/__/ - -*/ +//============================================================================================ +//FUNKTIONEN - +//MATRIX-FUNKTIONEN void shift_srg(); void reset_srg(); -void setSpeed(); -void init(); +void store_srg(); + +void initVal(void); void initArray(int const *letter, int size); -void setText(const string& text_dummy, int *matrix_text); -void setMatrix(int m_height,int m_length, int *matrix_text); +void TextMatrixConvert(const string& text_convertion, char *matrix_value, int m_length); +void setMatrix(int m_height,int m_length, char *matrix_value); + +void bluetooth_matrix(int m_length, int m_height, char *matrix_value); +void CustomTextCycleFinished(void); + +void BLE_ErrorHandler(char value); + +void Matrix(int m_length, int m_height, char *matrix_value); +//ECHTZEITUHR-FUNKTIONEN +void readTime(void); +void timeSettings(void); +void ReadTimeToString(void); +bool checkLeapyear(int yearVal); +bool checkDate(int yearVal, int monthVal, int dateVal); +void WinterSummerTime(int yearVal,int monthVal,int dateVal,int hourVal,int secondVal); +void textSwitcher(void); -void Matrix(int m_length, int m_height, int *matrix_text,const string text_generic); #endif \ No newline at end of file
diff -r d5472e4a55bf -r bd1352d4dbb8 main.cpp --- a/main.cpp Wed Oct 12 13:22:19 2016 +0000 +++ b/main.cpp Wed Jan 17 07:12:35 2018 +0000 @@ -4,15 +4,20 @@ //------------------------------------------------------------------------------------------------------ // editable Variables/Text //------------------------------------------------------------------------------------------------------ -string text_generic ("Hello World"); // is going to be used for the 'not-connected' state. -int m_length = 16; // length of the matrix -int m_height = 8; // height of the matrix -int matrix_text [500]; // How many Variables can be declared in the text-array +int m_length = 64; // length of the matrix +int m_height = 8; // height of the matrix +char matrix_value [512]; // How many Variables can be declared in the text-array + + //------------------------------------------------------------------------------------------------------ // Main //------------------------------------------------------------------------------------------------------ int main() { - Matrix(m_length,m_height,matrix_text,text_generic); + while(1) + { + Matrix(m_length,m_height,matrix_value); + } + }
diff -r d5472e4a55bf -r bd1352d4dbb8 mbed-rtos.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-rtos.lib Wed Jan 17 07:12:35 2018 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/mbed_official/code/mbed-rtos/#b744dfee1cf2
diff -r d5472e4a55bf -r bd1352d4dbb8 mbed.bld --- a/mbed.bld Wed Oct 12 13:22:19 2016 +0000 +++ b/mbed.bld Wed Jan 17 07:12:35 2018 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/0ab6a29f35bf \ No newline at end of file
diff -r d5472e4a55bf -r bd1352d4dbb8 project.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project.h Wed Jan 17 07:12:35 2018 +0000 @@ -0,0 +1,23 @@ +#ifndef PROJECT_H +#define PROJECT_H +//DEFINES----------------------------------------------------------------------- +#define FIRMWARE_VERSION 1 +#define TextStandard "maxon motor ag | Elektroniker" +#define matrixTIME 0 +#define matrixDATE 1 +#define matrixLOGO 2 +#define matrixCUSTOM 2 + +//ERROR +#define NO_ERROR 0 +#define INVALID_CMD 1 +#define CMD_NOT_COMPLETE 2 +#define CMD_NOT_IN_RANGE 3 +#define FEB_NO_LEAP 4 + +//TIMER-VARIABLES +#define TIME_CHANGE 6000 +#define TIME_CUSTOM_DEF 120 //120 seconds +//------------------------------------------------------------------------------ + +#endif \ No newline at end of file
diff -r d5472e4a55bf -r bd1352d4dbb8 setMatrix.cpp --- a/setMatrix.cpp Wed Oct 12 13:22:19 2016 +0000 +++ b/setMatrix.cpp Wed Jan 17 07:12:35 2018 +0000 @@ -1,544 +1,937 @@ -#include "initalize.h" -#include "alphabet.h" -#include "mbed.h" -#include <string> +#include "initalize.h" //Funktionenprototypen +#include "alphabet.h" //Header mit allen Buchstaben und Zeichen Variationen +#include "mbed.h" // +#include <string> // +#include "rtos.h" //Verwendet für RtosTimer +#include <BufferedSerial.h> //MCU besitzt eine Buffer-Limite von 16 bytes. Diese Library erweitert diese Limite +#include "DS3231.h" //Library für die Echtzeituhr DS3231 +#include "project.h" //Definitionen +#include "time_adjustment_dates.h" //Daten für die Winter und Sommerzeit + +//============================================================================================ +//VARIABLEN + -/* - __ __ _ _ _ - \ \ / /_ _ _ _(_)__ _| |__| |___ ___ - \ V / _` | '_| / _` | '_ \ / -_|_-< - \_/\__,_|_| |_\__,_|_.__/_\___/__/ +struct LED_Matrix +{ + DigitalOut ds,oe,stcp,shcp,mr; + LED_Matrix(PinName pin1, PinName pin2, PinName pin3, PinName pin4, PinName pin5) : ds(pin1), oe(pin2), stcp(pin3), shcp(pin4), mr(pin5) {}; +}; +//PIN-ASSIGNMENT------------------------------------------------------------------------------ +DS3231 RTC(p28,p27); //RTC über p28(SDA) und p27(SCL) verbunden + +BusOut led(LED1,LED2,LED3,LED4); + +LED_Matrix matrix(p5, p6, p7, p8, p9); //LED-Matrix Data, Enable, Storage, Shift, Masterreset + +RtosTimer customDuration(CustomTextCycleFinished); //Timer für benutzerdefinierter Text +RtosTimer TimerTextSwitch(textSwitcher); //Timer für den Wechsel zwischen Zeit und Datum + +BufferedSerial bluetooth(p13,p14); //Bluetooth Modul, tx, rx -*/ - -int m_speed, m_loop; +//GLOBAL VARIABLE---------------------------------------------------------------------------------- +//Clock +int rtc_hour; //Stunden +int rtc_minute; //Minuten +int rtc_second; //Sekunden +int rtc_date; //Datum +int rtc_dayOfWeek; //Tag der Woche +int rtc_month; //Monat +int rtc_year; //Jahr +// +//Time Values +int CustomDuration = TIME_CUSTOM_DEF; -int c_frame, // frame-counter - speed, // Variable for setting up, how fast the matrix would scroll - ble, // Variable as "getting text from Bluetooth"-signal - frames; // Variable for the scrolling of the text -string text_bluetooth (""); // will be empty, is going to be used for the bluetooth module -//------------------------------------------------------------------------------------------------------ +//bluetooth +string TextBluetooth (""); +char ErrorValue = 0; + +//matrix +bool matrix_setScroll = 1; +char textSwitch = matrixTIME; +string TextMatrix (""); + +int matrixPos = 0; +int matrix_frames; // Bilder-Counter +int matrix_moveFrame = 0; // Variable zum Verschieben des Textes + + +//ENUM & STRUCT------------------------------------------------------------------------------- + +//============================================================================================ -DigitalOut ds1(p5), oe1(p6), stcp1(p7), shcp1(p8), mr1(p9), led(LED1); -AnalogIn ain(p20); -Ticker tick; -Serial pc(USBTX, USBRX); // tx, rx -/* -DS normal Serial Data Output Schreibt vor ob das LED 0 oder 1 ist. -OE invertiert Output-Enable Aktiviert oder deaktiviert die LEDs. -SHCP normal Shift register clk Setzt Position mit kurzen Impulsen fest. -STCP normal Storage reg. clk Setzt Reihe mit kurzen Impulsen fest. -MR invertiert Master reset resetet den Storage. Muss mit STCP angezeigt werden. -*/ -//------------------------------------------------------------------------------------------------------ -/* - ___ _ _ - | __| _ _ _ __| |_(_)___ _ _ ___ - | _| || | ' \/ _| _| / _ \ ' \(_-< - |_| \_,_|_||_\__|\__|_\___/_||_/__/ - -*/ - -void Matrix(int m_length, int m_height, int *matrix_text,const string text_generic) +//============================================================================================ +//▄ ▄ ▄▄▄ ▄▄▄▄▄ ▄▄▄▄ ▄▄▄ ▄ ▄ +//█▀▄ ▄▀█ █ █ █ █ █ █ █ █ +//█ ▀ █ █▄▄▄█ █ █▄▄▄▀ █ ▀▄▀ +//█ █ █ █ █ █ ▀▄ █ ▄▀ ▀▄ +//█ █ █ █ █ █ ▀▄ ▄█▄ █ █ +//MATRIX======================================================================= +//Autor: Joel von Rotz +//Typ: void +//parameter: int m_length, int m_height, char *matrix_value +// Matrixlänge Matrixhöhe Array für Textwerte +//Beschreibung: +//============================================================================= +void Matrix(int m_length, int m_height, char *matrix_value) { - init(); + matrix.oe = 1; //Matrix ausschalten, damit keine unerwünschte LEDs leuchten. + TextMatrix = TextStandard; //Standard-Text zuweisen wait(0.5); - reset_srg(); - wait(0.05); - setText(text_generic,matrix_text); - wait(0.05); - setMatrix(m_height, m_length, matrix_text); + matrix.oe = 0; //Matrix wieder einschalten + + RTC.setI2Cfrequency(400000); + bluetooth.baud(115200); //Bluetooth Module Communication + + TimerTextSwitch.start(TIME_CHANGE); + + while(1) + { + initVal(); //Variabeln initialisieren + + for(int x = 0; x < 512; x++) //matrix_value "leeren" + matrix_value[x] = 0x00; + + + ReadTimeToString(); //Lese Zeit und konvertiere zu einem String + + + TextMatrixConvert(TextMatrix,matrix_value, m_length); + + /*Überprüft ob es sich um Winterzeit oder Sommerzeit handelt*/ + WinterSummerTime(rtc_year,rtc_month,rtc_date,rtc_hour,rtc_second); + //----------------------------// + if((matrix_frames-64) > m_length) + { + matrix_setScroll = 1; + } + else + { + matrix_setScroll = 0; + } + if(!matrix_setScroll) + { + matrix_moveFrame = 64; + } + //----------------------------// + setMatrix(m_height, m_length, matrix_value); + //----------------------------// + if(bluetooth.readable()) + { + bluetooth_matrix(m_length,m_height,matrix_value); + } + //----------------------------// + } } -void init() +//TEXTSWITCHER================================================================= +//Autor: Joel von Rotz +//Typ: void +//parameter: void +//Beschreibung: Wird für das Wechseln des Textes benötigt +//============================================================================= +void textSwitcher(void) +{ + matrixPos = 0; + matrix_moveFrame = 0; + textSwitch = !textSwitch; +} + +void CustomTextCycleFinished(void) +{ + TimerTextSwitch.start(TIME_CHANGE); + customDuration.stop(); + textSwitch = matrixTIME; + TextMatrix = TextStandard; + +} + +//INITVAL====================================================================== +//Autor: Joel von Rotz +//Typ: void +//parameter: void +//Beschreibung: Initialisierung der Variabeln und Ein-Ausgängen +//============================================================================= +void initVal(void) { - mr1 = 1; - oe1 = 0; - ds1 = 0; - stcp1 = 0; - shcp1 = 0; - frames = 0; - c_frame = 0; - m_loop = 1; + //Überprüfung, ob Text verschoben werden muss auf dem Display + + //===================== + //Output + matrix.mr = 1; + matrix.oe = 1; + matrix.ds = 0; + matrix.stcp = 0; + matrix.shcp = 0; + //===================== + //Variabeln + matrix_frames = 0; + TextBluetooth = ""; + reset_srg(); +} + +//MATRIX======================================================================= +//Autor: Joel von Rotz +//Typ: void +//parameter: int m_height, int m_length, char *matrix_value +//Beschreibung: Lässt Text oder anderes auf einer LED-Matrix anzeigen +//============================================================================= +// MATRIX +//Lässt einen Text auf dem Display anzeigen +void setMatrix(int m_height,int m_length, char *matrix_value) +{ + //clock wird als Zählvariable verwendet, darunter als Bitshifter und Multiplexer + for(int frequency = 0; frequency < 4; frequency++) + { + for(int clock = 0; clock < 8; clock++) + { + //Der Text muss von hinten nach vorne abgearbeitet werden, darum wird eine Variable + //names matrixPos verwendet, die die Position des Textes bestimmt. + if(matrixPos <= 0) + matrixPos = m_length; //setze matrixPos auf die letzte Position des Textes zurück + + + for(int fill = 0; fill < (m_length/8); fill++) + { + for(int column = 8; column > 0; column--) + { + matrix.ds = (matrix_value[matrixPos-column+matrix_moveFrame] >> clock) & 1; + shift_srg(); + } + matrixPos -= 8; + } + //Multiplexer + //mit dieser For-Schleife wird der Multiplex-Bit gesetzt + for(int cell = 0; cell < 8; cell++) + { + if(clock == cell) //ist clock gleich cell? + matrix.ds = 1; //setze Data-Pin auf 1 + else //Sonst + matrix.ds = 0; //setze auf 0 + shift_srg(); //Schiebe Data in die Register hinein + } + + store_srg(); + matrix.oe = 0; + wait_us(1000); + matrix.oe = 1; + } + + } + //=================================================================== + if(matrix_setScroll) + { + matrix_moveFrame++; + } + if(matrix_moveFrame >= matrix_frames) + { + matrix_moveFrame = 0; + } + //=================================================================== } +//Schieberegister mit einem Bit befüllen void shift_srg() { - wait_ms(0.05); // Perioden-Dauer 2ms, später verkürzen - shcp1 = 1; - wait_ms(0.05); - shcp1 = 0; + matrix.shcp = 1; + matrix.shcp = 0; } +//Speicher von den Schieberegister herausgeben +void store_srg() +{ + matrix.stcp = 1; + matrix.stcp = 0; +} + +//Schieberegister zurücksetzen void reset_srg() { - mr1 = 0; - wait_ms(0.05); // Reset-Puls 1ms, später verkürzen - mr1 = 1; + matrix.mr = 0; + matrix.mr = 1; } - -void setSpeed() +/*Steuerung für die LED-Matrix*/ +void bluetooth_matrix(int m_length, int m_height, char *matrix_value) { - // not possible with simple if-loops - if(ain > 0.125f) - m_speed = 10; - if(ain > 0.25f) - m_speed = 25; - if(ain > 0.375f) - m_speed = 50; - if(ain > 0.5f) - m_speed = 100; - if(ain > 0.625f) - m_speed = 250; - if(ain > 0.75f) - m_speed = 500; - if(ain > 0.875f) - m_speed = 1000; - if(ain > 0.97f) - m_speed = 2000; + TextBluetooth = ""; + ErrorValue = NO_ERROR; + string buff; + + while(bluetooth.readable()) + { + TextBluetooth += bluetooth.getc(); + } + //------------------------------------------ + //Bluetooth Nachrichten + if(TextBluetooth.size()==28 && TextBluetooth.find("matrixCONNECT") != string::npos) + { + TextMatrix = "Connected!"; + bluetooth.printf("Hallo! Schreibe etwas..."); + } + else if(TextBluetooth.size()==17 && TextBluetooth.find("matrixNEW_PAIRING") != string::npos || + TextBluetooth.size()==16 && TextBluetooth.find("matrixDISCONNECT") != string::npos ) + { + TextBluetooth = ""; + } + //------------------------------------------ + //Zeit einstellen + else if(TextBluetooth.at(0) == '?') //ist das erste Zeichen ein Befehlszeichen + { + TextBluetooth.erase(0,1); + /*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ + if(TextBluetooth.find("ST ")== 0) //Konfiguration Zeit + { TextBluetooth.erase(0,3); + if(TextBluetooth.size() == 8) + { + + buff.assign(TextBluetooth,0,2); + rtc_hour = atoi(buff.c_str()); + buff.assign(TextBluetooth,3,2); + rtc_minute = atoi(buff.c_str()); + buff.assign(TextBluetooth,6,2); + rtc_second = atoi(buff.c_str()); + if(rtc_hour <= 23 && rtc_minute <= 59 && rtc_second <= 59) + { + RTC.setTime(rtc_hour,rtc_minute,rtc_second); + } + else + { + ErrorValue = CMD_NOT_IN_RANGE; + } + } + else + { + ErrorValue = CMD_NOT_COMPLETE; + } + } + /*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ + else if(TextBluetooth.find("SD ")== 0) //Konfiguration Datum + { TextBluetooth.erase(0,3); + if(TextBluetooth.size() == 10) + { + /*Konvertiere String zu Int*/ + buff.assign(TextBluetooth,0,2); + rtc_date = atoi(buff.c_str()); + buff.assign(TextBluetooth,3,2); + rtc_month = atoi(buff.c_str()); + buff.assign(TextBluetooth,6,4); + rtc_year = atoi(buff.c_str()); + if(rtc_year <= 2100 && rtc_year >= 1900 && checkDate(rtc_year,rtc_month,rtc_date)) + { + RTC.setDate(0,rtc_date,rtc_month,rtc_year); + } + else if( ErrorValue == FEB_NO_LEAP) {} + else + { + ErrorValue = CMD_NOT_IN_RANGE; + } + } + else + { + ErrorValue = CMD_NOT_COMPLETE; + } + } + /*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ + else if(TextBluetooth.find("SW ")== 0) //Konfiguration Winterzeit + { TextBluetooth.erase(0,3); + TextBluetooth = "Winterzeit"; + } + /*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ + else if(TextBluetooth.find("SS ")== 0) //Konfiguration Sommerzeit + { TextBluetooth.erase(0,3); + TextBluetooth = "Sommerzeit"; + } + /*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ + else if(TextBluetooth.find("CD ")== 0) //Konfiguration Benutzerdefinierte Textdauer + { TextBluetooth.erase(0,3); + if(TextBluetooth.size() == 3) + { + CustomDuration = atoi(TextBluetooth.c_str()); + if(CustomDuration <= 600 && CustomDuration >= 1){} + else + { + ErrorValue = CMD_NOT_IN_RANGE; + CustomDuration = TIME_CUSTOM_DEF; + } + } + else + { + ErrorValue = CMD_NOT_COMPLETE; + } + } + /*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/ + else + { + ErrorValue = INVALID_CMD; + } + BLE_ErrorHandler(ErrorValue); + } + //----------------------------------------------------- + //Benutzerdefinierter Text + else + { + TextMatrix = TextBluetooth; + textSwitch = matrixCUSTOM; + TimerTextSwitch.stop(); //Stoppe den Timer für den Zeit-Datum-Wechsel + customDuration.start(CustomDuration*1000); //2 Minuten eigener Text + } } +void BLE_ErrorHandler(char value) +{ + switch(value) + { + case NO_ERROR: + TimerTextSwitch.start(TIME_CHANGE); + customDuration.stop(); + textSwitch = matrixTIME; + break; + case INVALID_CMD: + TextMatrix = "ERROR: Invalid Command"; + break; + case CMD_NOT_COMPLETE: + TextMatrix = "ERROR: Missing Command Parameters"; + break; + case CMD_NOT_IN_RANGE: + TextMatrix = "ERROR: Values Not In Range"; + break; + case FEB_NO_LEAP: + TextMatrix = "ERROR: February-Date Too Big (Not a Leapyear)"; + break; + } + if(value != NO_ERROR) + { + textSwitch = matrixCUSTOM; + TimerTextSwitch.stop(); //Stoppe den Timer für den Zeit-Datum-Wechsel + customDuration.start(10000); //2 Minuten eigener Text + } +} + +void WinterSummerTime(int yearVal,int monthVal,int dateVal,int hourVal,int secondVal) +{ + /*timeLock wird als Wiederholungsstop verwendet. Da bei der Winterzeit eine Stunden * + *zurückgestellt wird, wird die Zeit immer wieder um eine Stunde zurückgestellt. */ + static bool timeLock = 0; + + //Summertime + if( dateVal == summerdates[(yearVal % 2000)][0] && + monthVal == summerdates[(yearVal % 2000)][1] && + (yearVal % 2000)== summerdates[(yearVal % 2000)][2] && + hourVal == summerdates[(yearVal % 2000)][3] && + secondVal== summerdates[(yearVal % 2000)][4] && + timeLock == 1) + { + timeLock = 0; + hourVal += 1; + RTC.setTime(hourVal,rtc_minute,rtc_second); + } + //WINTERTIME + if( dateVal == winterdates[(yearVal % 2000)][0] && + monthVal == winterdates[(yearVal % 2000)][1] && + (yearVal % 2000)== winterdates[(yearVal % 2000)][2] && + hourVal == winterdates[(yearVal % 2000)][3] && + secondVal== winterdates[(yearVal % 2000)][4] && + timeLock == 0) + { + timeLock = 1; + hourVal -= 1; + RTC.setTime(hourVal,rtc_minute,rtc_second); + } +} + +//============================================================================= + -void setMatrix(int m_height,int m_length, int *matrix_text) +//TimeStringConvert============================================================ +//Autor: Joel von Rotz +//Typ: void +//parameter: void +//Beschreibung: +// Das Datum und die Uhrzeit wird am Terminal angezeigt. +//============================================================================= +void ReadTimeToString(void) { - //bool row_temp[m_height]; // temporary array for matrix output - - while(1) + RTC.readDateTime(&rtc_dayOfWeek,&rtc_date,&rtc_month,&rtc_year,&rtc_hour,&rtc_minute,&rtc_second); + char buff[100]; + if(textSwitch == matrixTIME) + { + sprintf(buff," %02i:%02i:%02i",rtc_hour,rtc_minute,rtc_second); + + } + else if(textSwitch == matrixDATE) + { + sprintf(buff," %02i.%02i.%04i",rtc_date,rtc_month,rtc_year); + } + if(textSwitch != matrixCUSTOM) { - for(int frequency = 0; frequency < 50; frequency++) - { - for(int position = 0; position < m_length; position++) - { - for(int column = 0; column < m_length; column++) - { - if(column == position) - { - ds1 = 1; - } - else - { - ds1 = 0; - } - shift_srg(); - } - - for(int shift_int = 0; shift_int < m_height; shift_int++) - { - ds1 = (matrix_text[position] >> shift_int) & 1; - shift_srg(); - } - stcp1 = 1; - wait_ms(0.5); - stcp1 = 0; - } - } - frames++; - if(frames == c_frame) - frames = 0; - } + TextMatrix = buff; + } } +//============================================================================= + +//SETDATEMAX=================================================================== +//Autor: Joel von Rotz +//Typ: char +//parameter: int monthVal (Monat wird übergeben) +//Beschreibung: +// Es wird anhand dem Monat die dazugehörigen maximalen Tagen zurück- +// gegeben. +//============================================================================= +bool checkDate(int yearVal, int monthVal, int dateVal) +{ + const char month_limit[12]={31,28,31,30,31,30,31,31,30,31,30,31}; + if(monthVal == februar && checkLeapyear(yearVal)) + { return true; } + else if(dateVal > 28 && monthVal == februar) + { + ErrorValue = FEB_NO_LEAP; + return false; + } + if(dateVal <= month_limit[monthVal-1] && dateVal >= 1) + { return true; } + else + { return false; } +} +//============================================================================= -void initArray(int const *letter, int size, int *matrix_text) +//CHECKLEAPYEAR================================================================ +//Autor: Joel von Rotz +//Typ: bool +//parameter: int yearVal +//Beschreibung: +// Es wird überprüft, ob das Jahr ein Schaltjahr ist oder nicht. +// Dabei ist das Jahr NUR ein Schaltjahr, wenn das Jahr durch 4 oder durch 400 +// teilbar, aber sobald es durch 100 teilbar ist, ist es kein Schaltjahr. +// Source -> Gregorianischer Kalender +//============================================================================= +#define ISLEAPYEAR 1 +#define ISNOTLEAPYEAR 0 +bool checkLeapyear(int yearVal) { - c_frame = c_frame + 1; // A small space, about 1 led column, is being added. + if(yearVal % 4 == 0) + { + if(yearVal % 100 == 0) + { + if(yearVal % 400 == 0) + { + return ISLEAPYEAR; //ist Schaltjahr + } + return ISNOTLEAPYEAR; //ist nicht Schaltjahr + } + return ISLEAPYEAR; //ist Schaltjahr + } + return ISNOTLEAPYEAR; //ist nicht Schaltjahr +} +//============================================================================= + +void initArray(int const *letter, int size, char *matrix_value) +{ + matrix_frames = matrix_frames + 1; /*A small space, about 1 led column, is being added. */ for(int position = 0; position < size; position++) { - matrix_text[c_frame] = letter[position]; - c_frame++; + /* Hex-values are added to the matrix-text and matrix_frames is incremented */ + matrix_value[matrix_frames] = letter[position]; + matrix_frames++; } - matrix_text[c_frame] = 0x00; + matrix_value[matrix_frames] = 0x00; } -void setText(const string& text_dummy, int *matrix_text) -// Used to identifiy which letter is in the set String-Position. -// If it contains a specific letter, it will call another Function called "initArray" to fill up the array which is then used to show the letters on the Matrix +//=============================================================================// +//=============================================================================// +void TextMatrixConvert(const string& text_convertion, char *matrix_value, int m_length) { - for(int LetterPos = 0; LetterPos < text_dummy.size(); LetterPos++) + matrix_frames = matrix_frames + 64; + for(int LetterPos = 0; LetterPos < text_convertion.size(); LetterPos++) { //Letters ------------------------ - if (text_dummy.at(LetterPos) == 'A') + if (text_convertion.at(LetterPos) == 'A') { - initArray(A,4,matrix_text); + initArray(A,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'a') + else if(text_convertion.at(LetterPos) == 'a') { - initArray(a,4,matrix_text); + initArray(a,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'B') + else if(text_convertion.at(LetterPos) == 'B') { - initArray(B,4,matrix_text); + initArray(B,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'b') + else if(text_convertion.at(LetterPos) == 'b') { - initArray(b,5,matrix_text); + initArray(b,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'C') + else if(text_convertion.at(LetterPos) == 'C') { - initArray(C,4,matrix_text); + initArray(C,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'c') + else if(text_convertion.at(LetterPos) == 'c') { - initArray(c,4,matrix_text); + initArray(c,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'D') + else if(text_convertion.at(LetterPos) == 'D') { - initArray(D,4,matrix_text); + initArray(D,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'd') + else if(text_convertion.at(LetterPos) == 'd') { - initArray(d,5,matrix_text); + initArray(d,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 'E') + else if(text_convertion.at(LetterPos) == 'E') { - initArray(E,4,matrix_text); + initArray(E,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'e') + else if(text_convertion.at(LetterPos) == 'e') { - initArray(e,4,matrix_text); + initArray(e,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'F') + else if(text_convertion.at(LetterPos) == 'F') { - initArray(F,4,matrix_text); + initArray(F,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'f') + else if(text_convertion.at(LetterPos) == 'f') { - initArray(f,3,matrix_text); + initArray(f,3,matrix_value); } - else if(text_dummy.at(LetterPos) == 'G') + else if(text_convertion.at(LetterPos) == 'G') { - initArray(G,4,matrix_text); + initArray(G,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'g') + else if(text_convertion.at(LetterPos) == 'g') { - initArray(g,4,matrix_text); + initArray(g,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'H') + else if(text_convertion.at(LetterPos) == 'H') { - initArray(H,4,matrix_text); + initArray(H,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'h') + else if(text_convertion.at(LetterPos) == 'h') { - initArray(h,5,matrix_text); + initArray(h,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 'I') + else if(text_convertion.at(LetterPos) == 'I') { - initArray(I,3,matrix_text); + initArray(I,3,matrix_value); } - else if(text_dummy.at(LetterPos) == 'i') + else if(text_convertion.at(LetterPos) == 'i') { - initArray(i,3,matrix_text); + initArray(i,3,matrix_value); } - else if(text_dummy.at(LetterPos) == 'J') + else if(text_convertion.at(LetterPos) == 'J') { - initArray(J,4,matrix_text); + initArray(J,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'j') + else if(text_convertion.at(LetterPos) == 'j') { - initArray(j,3,matrix_text); + initArray(j,3,matrix_value); } - else if(text_dummy.at(LetterPos) == 'K') + else if(text_convertion.at(LetterPos) == 'K') { - initArray(K,5,matrix_text); + initArray(K,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 'k') + else if(text_convertion.at(LetterPos) == 'k') { - initArray(k,4,matrix_text); + initArray(k,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'L') + else if(text_convertion.at(LetterPos) == 'L') { - initArray(L,4,matrix_text); + initArray(L,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'l') + else if(text_convertion.at(LetterPos) == 'l') { - initArray(l,3,matrix_text); + initArray(l,3,matrix_value); } - else if(text_dummy.at(LetterPos) == 'M') + else if(text_convertion.at(LetterPos) == 'M') { - initArray(M,5,matrix_text); + initArray(M,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 'm') + else if(text_convertion.at(LetterPos) == 'm') { - initArray(m,5,matrix_text); + initArray(m,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 'N') + else if(text_convertion.at(LetterPos) == 'N') { - initArray(N,5,matrix_text); + initArray(N,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 'n') + else if(text_convertion.at(LetterPos) == 'n') { - initArray(n,4,matrix_text); + initArray(n,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'O') + else if(text_convertion.at(LetterPos) == 'O') { - initArray(O,4,matrix_text); + initArray(O,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'o') + else if(text_convertion.at(LetterPos) == 'o') { - initArray(o,5,matrix_text); + initArray(o,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 'P') + else if(text_convertion.at(LetterPos) == 'P') { - initArray(P,4,matrix_text); + initArray(P,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'p') + else if(text_convertion.at(LetterPos) == 'p') { - initArray(p,4,matrix_text); + initArray(p,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'Q') + else if(text_convertion.at(LetterPos) == 'Q') { - initArray(Q,5,matrix_text); + initArray(Q,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 'q') + else if(text_convertion.at(LetterPos) == 'q') { - initArray(q,4,matrix_text); + initArray(q,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'R') + else if(text_convertion.at(LetterPos) == 'R') { - initArray(R,4,matrix_text); + initArray(R,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'r') + else if(text_convertion.at(LetterPos) == 'r') { - initArray(r,3,matrix_text); + initArray(r,3,matrix_value); } - else if(text_dummy.at(LetterPos) == 'S') + else if(text_convertion.at(LetterPos) == 'S') { - initArray(S,4,matrix_text); + initArray(S,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 's') + else if(text_convertion.at(LetterPos) == 's') { - initArray(s,4,matrix_text); + initArray(s,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'T') + else if(text_convertion.at(LetterPos) == 'T') { - initArray(T,5,matrix_text); + initArray(T,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 't') + else if(text_convertion.at(LetterPos) == 't') { - initArray(t,3,matrix_text); + initArray(t,3,matrix_value); } - else if(text_dummy.at(LetterPos) == 'U') + else if(text_convertion.at(LetterPos) == 'U') { - initArray(U,4,matrix_text); + initArray(U,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'u') + else if(text_convertion.at(LetterPos) == 'u') { - initArray(u,5,matrix_text); + initArray(u,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 'V') + else if(text_convertion.at(LetterPos) == 'V') { - initArray(V,5,matrix_text); + initArray(V,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 'v') + else if(text_convertion.at(LetterPos) == 'v') { - initArray(v,5,matrix_text); + initArray(v,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 'W') + else if(text_convertion.at(LetterPos) == 'W') { - initArray(W,5,matrix_text); + initArray(W,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 'w') + else if(text_convertion.at(LetterPos) == 'w') { - initArray(w,5,matrix_text); + initArray(w,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 'X') + else if(text_convertion.at(LetterPos) == 'X') { - initArray(X,4,matrix_text); + initArray(X,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'x') + else if(text_convertion.at(LetterPos) == 'x') { - initArray(x,4,matrix_text); + initArray(x,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'Y') + else if(text_convertion.at(LetterPos) == 'Y') { - initArray(Y,5,matrix_text); + initArray(Y,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 'y') + else if(text_convertion.at(LetterPos) == 'y') { - initArray(y,5,matrix_text); + initArray(y,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 'Z') + else if(text_convertion.at(LetterPos) == 'Z') { - initArray(Z,4,matrix_text); + initArray(Z,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 'z') + else if(text_convertion.at(LetterPos) == 'z') { - initArray(z,4,matrix_text); + initArray(z,4,matrix_value); } // Numbers ----------------------- - else if(text_dummy.at(LetterPos) == '0') + else if(text_convertion.at(LetterPos) == '0') { - initArray(zero,4,matrix_text); + initArray(zero,4,matrix_value); } - else if(text_dummy.at(LetterPos) == '1') + else if(text_convertion.at(LetterPos) == '1') { - initArray(one,3,matrix_text); + initArray(one,4,matrix_value); } - else if(text_dummy.at(LetterPos) == '2') + else if(text_convertion.at(LetterPos) == '2') { - initArray(two,4,matrix_text); + initArray(two,4,matrix_value); } - else if(text_dummy.at(LetterPos) == '3') + else if(text_convertion.at(LetterPos) == '3') { - initArray(three,4,matrix_text); + initArray(three,4,matrix_value); } - else if(text_dummy.at(LetterPos) == '4') + else if(text_convertion.at(LetterPos) == '4') { - initArray(four,4,matrix_text); + initArray(four,4,matrix_value); } - else if(text_dummy.at(LetterPos) == '5') + else if(text_convertion.at(LetterPos) == '5') { - initArray(five,4,matrix_text); + initArray(five,4,matrix_value); } - else if(text_dummy.at(LetterPos) == '6') + else if(text_convertion.at(LetterPos) == '6') { - initArray(six,4,matrix_text); + initArray(six,4,matrix_value); } - else if(text_dummy.at(LetterPos) == '7') + else if(text_convertion.at(LetterPos) == '7') { - initArray(seven,4,matrix_text); + initArray(seven,4,matrix_value); } - else if(text_dummy.at(LetterPos) == '8') + else if(text_convertion.at(LetterPos) == '8') { - initArray(eight,4,matrix_text); + initArray(eight,4,matrix_value); } - else if(text_dummy.at(LetterPos) == '9') + else if(text_convertion.at(LetterPos) == '9') { - initArray(nine,4,matrix_text); + initArray(nine,4,matrix_value); } // Symbols ----------------------- - else if(text_dummy.at(LetterPos) == '!') + else if(text_convertion.at(LetterPos) == '!') { - initArray(exclam,1,matrix_text); + initArray(exclam,1,matrix_value); } - else if(text_dummy.at(LetterPos) == '?') + else if(text_convertion.at(LetterPos) == '?') { - initArray(quest,3,matrix_text); + initArray(quest,3,matrix_value); } - else if(text_dummy.at(LetterPos) == 34) + else if(text_convertion.at(LetterPos) == 34) { - initArray(quote,3,matrix_text); + initArray(quote,3,matrix_value); } - else if(text_dummy.at(LetterPos) == '#') + else if(text_convertion.at(LetterPos) == '#') { - initArray(hash,5,matrix_text); + initArray(hash,5,matrix_value); } - else if(text_dummy.at(LetterPos) == '$') + else if(text_convertion.at(LetterPos) == '$') { - initArray(dollar,5,matrix_text); + initArray(dollar,5,matrix_value); } - else if(text_dummy.at(LetterPos) == '%') + else if(text_convertion.at(LetterPos) == '%') { - initArray(prcent,7,matrix_text); + initArray(prcent,7,matrix_value); } - else if(text_dummy.at(LetterPos) == '&') + else if(text_convertion.at(LetterPos) == '&') { - initArray(_and,5,matrix_text); + initArray(_and,5,matrix_value); } - else if(text_dummy.at(LetterPos) == '(') + else if(text_convertion.at(LetterPos) == '(') { - initArray(round_o,2,matrix_text); + initArray(round_o,2,matrix_value); } - else if(text_dummy.at(LetterPos) == ')') + else if(text_convertion.at(LetterPos) == ')') { - initArray(round_c,2,matrix_text); + initArray(round_c,2,matrix_value); } - else if(text_dummy.at(LetterPos) == '*') + else if(text_convertion.at(LetterPos) == '*') { - initArray(star,5,matrix_text); + initArray(star,5,matrix_value); } - else if(text_dummy.at(LetterPos) == '+') + else if(text_convertion.at(LetterPos) == '+') { - initArray(plus,5,matrix_text); + initArray(plus,5,matrix_value); } - else if(text_dummy.at(LetterPos) == '-') + else if(text_convertion.at(LetterPos) == '-') { - initArray(minus,3,matrix_text); + initArray(minus,3,matrix_value); } - else if(text_dummy.at(LetterPos) == '=') + else if(text_convertion.at(LetterPos) == '=') { - initArray(_equal,3,matrix_text); + initArray(_equal,4,matrix_value); } - else if(text_dummy.at(LetterPos) == ',') + else if(text_convertion.at(LetterPos) == ',') { - initArray(comma,2,matrix_text); + initArray(comma,2,matrix_value); } - else if(text_dummy.at(LetterPos) == '.') + else if(text_convertion.at(LetterPos) == '.') { - initArray(point,1,matrix_text); + initArray(point,1,matrix_value); } - else if(text_dummy.at(LetterPos) == '/') + else if(text_convertion.at(LetterPos) == '/') { - initArray(slash,5,matrix_text); + initArray(slash,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 58) + else if(text_convertion.at(LetterPos) == 58) { - initArray(d_point,1,matrix_text); + initArray(d_point,1,matrix_value); } - else if(text_dummy.at(LetterPos) == 59) + else if(text_convertion.at(LetterPos) == 59) { - initArray(poicom,2,matrix_text); + initArray(poicom,2,matrix_value); } - else if(text_dummy.at(LetterPos) == 95) + else if(text_convertion.at(LetterPos) == 95) { - initArray(undlin,4,matrix_text); + initArray(undlin,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 92) + else if(text_convertion.at(LetterPos) == 92) { - initArray(b_slash,5,matrix_text); + initArray(b_slash,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 64) + else if(text_convertion.at(LetterPos) == 64) { - initArray(at,5,matrix_text); + initArray(at,5,matrix_value); } - else if(text_dummy.at(LetterPos) == 62) + else if(text_convertion.at(LetterPos) == 62) { - initArray(more,4,matrix_text); + initArray(more,4,matrix_value); } - else if(text_dummy.at(LetterPos) == 60) + else if(text_convertion.at(LetterPos) == 60) { - initArray(less,1,matrix_text); + initArray(less,4,matrix_value); } - else if(text_dummy.at(LetterPos) == '[') + else if(text_convertion.at(LetterPos) == '[') { - initArray(brack_o,2,matrix_text); + initArray(brack_o,2,matrix_value); } - else if(text_dummy.at(LetterPos) == ']') + else if(text_convertion.at(LetterPos) == ']') { - initArray(brack_c,2,matrix_text); + initArray(brack_c,2,matrix_value); } - else if(text_dummy.at(LetterPos) == 94) + else if(text_convertion.at(LetterPos) == 94) { - initArray(roof,3,matrix_text); + initArray(roof,3,matrix_value); } - else if(text_dummy.at(LetterPos) == '{') + else if(text_convertion.at(LetterPos) == '{') { - initArray(brace_o,3,matrix_text); + initArray(brace_o,3,matrix_value); } - else if(text_dummy.at(LetterPos) == '}') + else if(text_convertion.at(LetterPos) == '}') { - initArray(brace_c,3,matrix_text); + initArray(brace_c,3,matrix_value); } - else if(text_dummy.at(LetterPos) == '~') + else if(text_convertion.at(LetterPos) == '~') { - initArray(wave,4,matrix_text); + initArray(wave,4,matrix_value); } - else if(text_dummy.at(LetterPos) == '|') + else if(text_convertion.at(LetterPos) == '|') { - initArray(stick,1,matrix_text); + initArray(stick,1,matrix_value); } - else if(text_dummy.at(LetterPos) == '`') + else if(text_convertion.at(LetterPos) == '`') { - initArray(frapo,2,matrix_text); + initArray(frapo,2,matrix_value); } - else if(text_dummy.at(LetterPos) == ' ') + else if(text_convertion.at(LetterPos) == ' ') { - initArray(space,3,matrix_text); + initArray(space,3,matrix_value); } } - c_frame += 3; -} \ No newline at end of file +} + +//============================================================================================ +//▄▄▄ ▄▄ ▄▄ ▄▄ ▄▄ ▄ +//█ █ █ ▀ ▀ █ ▀ █ ▀ █ ▀█ +//█ █ ▀▄▄ ▄▄▀ ▄▄▀ ▄▄▀ █ +//█ █ █ █ █ █ █ +//█▄▄▀ ▀▄▄▀ ▀▄▄▀ ▀▄▄▀ ▀▄▄▀ ▄█▄ \ No newline at end of file
diff -r d5472e4a55bf -r bd1352d4dbb8 time_adjustment_dates.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/time_adjustment_dates.h Wed Jan 17 07:12:35 2018 +0000 @@ -0,0 +1,66 @@ +enum monthNames +{ + januar = 1, //1 + februar, //2 + marz, //3 + april, //4 + mai, //5 + juni, //6 + juli, //7 + august, //8 + september, //9 + oktober, //10 + november, //11 + dezember, //12 +}; +//-------------------------// +char year_limit = 20; +//-------------------------// +char summerdates[21][5] = //[Years] [date,month,year,hour,seconds] +{ + {26,3,0,2,0}, + {25,3,1,2,0}, + {31.3,2,2,0}, + {30,3,3,2,0}, + {28,3,4,2,0}, + {27,3,5,2,0}, + {26,3,6,2,0}, + {25,3,7,2,0}, + {30,3,8,2,0}, + {29,3,9,2,0}, + {28,3,10,2,0}, + {27,3,11,2,0}, + {25,3,12,2,0}, + {31,3,13,2,0}, + {30,3,14,2,0}, + {29,3,15,2,0}, + {27,3,16,2,0}, + {26,3,17,2,0}, + {25,3,18,2,0}, + {31,3,19,2,0}, + {29,3,20,2,0} +}; +char winterdates[21][5] = //[Years] [date,month,year,hour,seconds] +{ + {29,10,0,3,00}, + {28,10,1,3,00}, + {27,10,2,3,00}, + {26,10,3,3,00}, + {31,10,4,3,00}, + {30,10,5,3,00}, + {29,10,6,3,00}, + {28,10,7,3,00}, + {26,10,8,3,00}, + {25,10,9,3,00}, + {31,10,10,3,00}, + {30,10,11,3,00}, + {28,10,12,3,00}, + {27,10,13,3,00}, + {26,10,14,3,00}, + {25,10,15,3,00}, + {30,10,16,3,00}, + {29,10,17,3,00}, + {28,10,18,3,00}, + {27,10,19,3,00}, + {25,10,20,3,00} +}; \ No newline at end of file