LPC1768 programm for the led matrix.

Dependencies:   BufferedSerial DS3231 mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
JOEV
Date:
Wed Oct 12 13:22:19 2016 +0000
Parent:
1:3a39b1439456
Child:
3:bd1352d4dbb8
Commit message:
Working code for a 8x8-Matrix; ; _______________Next Steps_______________; > Make code compatible with other resolutions; > Bluetooth function

Changed in this revision

alphabet.h Show annotated file Show diff for this revision Revisions of this file
initalize.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
setMatrix.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/alphabet.h	Wed Oct 12 13:22:19 2016 +0000
@@ -0,0 +1,72 @@
+#ifndef ALPHABET_H   // if alphabet.h hasn't been included yet...
+#define ALPHABET_H   // #define this so the compiler knows it has been included
+//------------------------------------------------------------------------------------------------------
+/*
+    _   _      _         _         _   
+   /_\ | |_ __| |_  __ _| |__  ___| |_ 
+  / _ \| | '_ \ ' \/ _` | '_ \/ -_)  _|
+ /_/ \_\_| .__/_||_\__,_|_.__/\___|\__|
+         |_|                           
+*/
+// Letters
+int         A[] = {0x3F,0x48,0x48,0x3F},        a[] = {0x13,0x15,0x15,0x0F},        //  A   a
+            B[] = {0x7F,0x49,0x49,0x77},        b[] = {0x7F,0x11,0x11,0x0E},        //  B   b
+            C[] = {0x3E,0x41,0x41,0x41},        c[] = {0x0E,0x11,0x11,0x11},        //  C   c
+            D[] = {0x7F,0x41,0x41,0x3E},        d[] = {0x0E,0x11,0x11,0x11,0x7F},   //  D   d
+            E[] = {0x7F,0x49,0x49,0x41},        e[] = {0x0E,0x15,0x15,0x0D},        //  E   e
+            F[] = {0x7F,0x48,0x48,0x40},        f[] = {0x08,0x7F,0x48},             //  F   f
+            G[] = {0x7F,0x41,0x49,0x4F},        g[] = {0x0D,0x15,0x15,0x1E},        //  G   g
+            H[] = {0x7F,0x08,0x08,0x7F},        h[] = {0x7F,0x10,0x10,0x10,0x0F},   //  H   h
+            I[] = {0x41,0x7F,0x41},             i[] = {0x11,0x5F,0x01},             //  I   i
+            J[] = {0x02,0x01,0x01,0x7E},        j[] = {0x01,0x11,0x5F},             //  J   j
+            K[] = {0x7F,0x08,0x14,0x22,0x41},   k[] = {0x7F,0x04,0x0A,0x11},        //  K   k
+            L[] = {0x7F,0x01,0x01,0x01},        l[] = {0x41,0x7F,0x01},             //  L   l
+            M[] = {0x7F,0x30,0x18,0x30,0x7F},   m[] = {0x1F,0x10,0x1F,0x10,0x0F},   //  M   m
+            N[] = {0x7F,0x30,0x08,0x06,0x7F},   n[] = {0x1F,0x10,0x10,0x0F},        //  N   n
+            O[] = {0x3E,0x41,0x41,0x3E},        o[] = {0x0E,0x11,0x11,0x11,0x0E},   //  O   o
+            P[] = {0x7F,0x48,0x48,0x30},        p[] = {0x1F,0x14,0x14,0x08},        //  P   p
+            Q[] = {0x3C,0x42,0x42,0x43,0x3D},   q[] = {0x08,0x14,0x14,0x1F},        //  Q   q
+            R[] = {0x7F,0x4C,0x4A,0x31},        r[] = {0x1F,0x10,0x08},             //  R   r
+            S[] = {0x32,0x49,0x49,0x26},        s[] = {0x09,0x15,0x15,0x12},        //  S   s
+            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
+            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
+            two[]     = {0x23,0x45,0x49,0x31},      //  2
+            three[]   = {0x22,0x41,0x49,0x36},      //  3
+            four[]    = {0x7C,0x04,0x7F,0x04},      //  4
+            five[]    = {0x7A,0x49,0x49,0x46},      //  5
+            six[]     = {0x3E,0x49,0x49,0x26},      //  6
+            seven[]   = {0x40,0x43,0x4C,0x70},      //  7
+            eight[]   = {0x36,0x49,0x49,0x36},      //  8
+            nine[]    = {0x32,0x49,0x49,0x3E},      //  9
+        //  Symbols
+            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},                               //  %
+            _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},           //  -   =
+            comma[]   = {0x01,0x06},                point[]   = {0x01},                     //  ,   .
+            slash[]   = {0x01,0x06,0x08,0x30,0x40}, d_point[] = {0x14},                     //  /   :
+            poicom[]  = {0x01,0x16},                undlin[]  = {0x01,0x01,0x01,0x01},      //  ;   _
+            b_slash[] = {0x40,0x30,0x08,0x06,0x01}, at[]      = {0x3E,0x41,0x5D,0x55,0x39}, //  \   @
+            more[]    = {0x22,0x14,0x14,0x08},      less[]    = {0x08,0x14,0x14,0x22},      //  >   <
+            brack_o[] = {0x7F,0x41},                brack_c[] = {0x41,0x7F},                //  [   ]
+            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
+;
+//-------------------------
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/initalize.h	Wed Oct 12 13:22:19 2016 +0000
@@ -0,0 +1,26 @@
+#ifndef INITALIZE_H
+#define INITALIZE_H
+
+#include <string>
+#include "mbed.h"
+//------------------------------------------------------------------------------------------------------
+/*
+  ___             _   _             
+ | __|  _ _ _  __| |_(_)___ _ _  ___
+ | _| || | ' \/ _|  _| / _ \ ' \(_-<
+ |_| \_,_|_||_\__|\__|_\___/_||_/__/
+                                    
+*/
+
+
+void shift_srg(); 
+void reset_srg(); 
+void setSpeed();
+void init();
+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 Matrix(int m_length, int m_height, int *matrix_text,const string text_generic);
+#endif 
\ No newline at end of file
--- a/main.cpp	Wed Aug 03 07:28:20 2016 +0000
+++ b/main.cpp	Wed Oct 12 13:22:19 2016 +0000
@@ -1,186 +1,18 @@
-#include <mbed.h>
+#include "initalize.h"
+#include "mbed.h"
 #include <string>
-#include <ctype.h>
-
-
-//------------------------------------------------------------------------------------------------------
-// Analog I/O, Digital I/O, etc.
-//------------------------------------------------------------------------------------------------------
-DigitalOut  ds1(p5), oe1(p6), stcp1(p7), shcp1(p8), mr1(p9);
-AnalogIn    ain(p20);
-Ticker      tick;
-/*
-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.
-
-*/
-//------------------------------------------------------------------------------------------------------
-// Voids & Ticker, Ints, etc.
 //------------------------------------------------------------------------------------------------------
-int a = 0, x, y, z, t, temp, speed=10;
-
-int zahl[][8] ={
-{255,255,112,56,56,112,255,255},
-{255,112,56,56,112,255,255,0},
-{112,56,56,112,255,255,0,2},
-{56,56,112,255,255,0,2,23},
-{56,112,255,255,0,2,23,21},
-{112,255,255,0,2,23,21,21},
-{255,255,0,2,23,21,21,31},
-{255,0,2,23,21,21,31,15},
-{0,2,23,21,21,31,15,0},
-{2,23,21,21,31,15,0,17},
-{23,21,21,31,15,0,17,27},
-{21,21,31,15,0,17,27,14},
-{21,31,15,0,17,27,14,14},
-{31,15,0,17,27,14,14,27},
-{15,0,17,27,14,14,27,17},
-{0,17,27,14,14,27,17,0},
-{17,27,14,14,27,17,0,14},
-{27,14,14,27,17,0,14,31},
-{14,14,27,17,0,14,31,17},
-{14,27,17,0,14,31,17,17},
-{27,17,0,14,31,17,17,31},
-{17,0,14,31,17,17,31,14},
-{0,14,31,17,17,31,14,0},
-{14,31,17,17,31,14,0,31},
-{31,17,17,31,14,0,31,31},
-{17,17,31,14,0,31,31,24},
-{17,31,14,0,31,31,24,24},
-{31,14,0,31,31,24,24,31},
-{14,0,31,31,24,24,31,15},
-{0,31,31,24,24,31,15,0},
-{31,31,24,24,31,15,0,0},
-{31,24,24,31,15,0,0,0},
-{24,24,31,15,0,0,0,0},
-{24,31,15,0,0,0,0,0},
-{31,15,0,0,0,0,0,0},
-{15,0,0,0,0,0,0,0},
-{0,0,0,0,0,0,0,0},
-{0,0,0,0,0,0,0,255},
-{0,0,0,0,0,0,255,255},
-{0,0,0,0,0,255,255,112},
-{0,0,0,0,255,255,112,56},
-{0,0,0,255,255,112,56,56},
-{0,0,255,255,112,56,56,112},
-{0,255,255,112,56,56,112,255}
-
-
-};
-
-int const size_y = sizeof(zahl)     /   sizeof(zahl[0]);
-int const size_x = sizeof(zahl[0])  /   sizeof(zahl[0][0]);
-
-bool row_temp[8];
-void shift_srg(), reset_srg(), setSpeed();   //, set_srg(bool status_[]);
+// editable Variables/Text
 //------------------------------------------------------------------------------------------------------
-// Vorgang
-//------------------------------------------------------------------------------------------------------
-/*
-Zuerst müssen die ersten 8 DS den Wert 1 entsprechen, weil diese für die Kathoden Seite der Matrix ist.
-Die beiden 74HC595-ICs sind miteinander über dem Q7s und DS verbunden. Was aus dem ersten IC herauskommt,
-wird beim zweiten als Eingangswert benützt.
-*/
+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
 //------------------------------------------------------------------------------------------------------
 // Main
 //------------------------------------------------------------------------------------------------------
 int main()
 {
-    mr1 = 1;
-    oe1 = 0;
-    ds1 = 0;
-    stcp1 = 0;
-    shcp1 = 0;
-    
-    tick.attach(&setSpeed,0.005);
-    reset_srg();
-    
-    
-    
-    while(1)
-    {
-        for(t = 0; t < speed; t++)
-        {
-            for(z = 0; z < 8; z++)
-            {
-                
-                for(y = 0; y < 8; y++)
-                {
-                    row_temp[y] = (zahl[a][z] >> y) & 1;
-                }
-                
-                for(x = 0; x < 8; x++)
-                {
-                    if(x == z)
-                    {
-                        ds1 = 1;
-                    }
-                    else
-                    {
-                        ds1 = 0;
-                    }
-                    shift_srg();
-                }
-                
-                for(x = 0; x < 8; x++)
-                {
-                    ds1 = row_temp[x];
-                    shift_srg();
-                }
-                
-                stcp1 = 1;
-                wait_ms(0.1);
-                stcp1 = 0;
-                
-            }
-        }
-        a++;
-        if(a == size_y)
-            a = 0;
-    }
-}   // Ende main
-
-
-//------------------------------------------------------------------------------------------------------
-// Voids & Floats
-//------------------------------------------------------------------------------------------------------
-
-void shift_srg()
-{
-    wait_ms(0.1);     // Perioden-Dauer 2ms, später verkürzen
-    shcp1 = 1;
-    wait_ms(0.1);
-    shcp1 = 0;
+    Matrix(m_length,m_height,matrix_text,text_generic);
 }
 
-void reset_srg()
-{
-    mr1 = 0;
-    wait_ms(0.1);     // Reset-Puls 1ms, später verkürzen
-    mr1 = 1;   
-}
-
-void setSpeed()
-{
-    speed = ain * 1000;
-}
-
-/*
-for(x = 0; x < 16; x++)
-    {
-        switch(x)
-        {   // 0-7 = Kathode, 8-15 = Anoden
-        case 7: case 9: case 10: case 11: case 13: case 14: case 15:
-            ds1 = 1;
-            shift_srg();
-            break;
-        default:
-            ds1 = 0;
-            shift_srg();
-            break;
-        }    
-    }*/
-    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/setMatrix.cpp	Wed Oct 12 13:22:19 2016 +0000
@@ -0,0 +1,544 @@
+#include "initalize.h"
+#include "alphabet.h"
+#include "mbed.h"
+#include <string>
+
+/*
+ __   __        _      _    _        
+ \ \ / /_ _ _ _(_)__ _| |__| |___ ___
+  \ V / _` | '_| / _` | '_ \ / -_|_-<
+   \_/\__,_|_| |_\__,_|_.__/_\___/__/
+
+*/
+
+int m_speed, m_loop;
+
+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
+//------------------------------------------------------------------------------------------------------
+
+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)
+{
+    init();
+    wait(0.5);
+    reset_srg();
+    wait(0.05);
+    setText(text_generic,matrix_text);
+    wait(0.05);
+    setMatrix(m_height, m_length, matrix_text);
+}
+
+void init()
+{
+    mr1 = 1;
+    oe1 = 0;
+    ds1 = 0;
+    stcp1 = 0;
+    shcp1 = 0;
+    frames = 0;
+    c_frame = 0;
+    m_loop = 1;
+}
+
+
+void shift_srg()
+{
+    wait_ms(0.05);     // Perioden-Dauer 2ms, später verkürzen
+    shcp1 = 1;
+    wait_ms(0.05);
+    shcp1 = 0;
+}
+
+void reset_srg()
+{
+    mr1 = 0;
+    wait_ms(0.05);     // Reset-Puls 1ms, später verkürzen
+    mr1 = 1;   
+}
+
+
+void setSpeed()
+{
+    // 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;
+}
+
+
+void setMatrix(int m_height,int m_length, int *matrix_text)
+{
+    //bool row_temp[m_height];           // temporary array for matrix output
+       
+    while(1)
+    {
+        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;
+     }
+}
+
+
+void initArray(int const *letter, int size, int *matrix_text)
+{
+    c_frame = c_frame + 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++;
+    }
+    matrix_text[c_frame] = 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
+{
+    for(int LetterPos = 0; LetterPos < text_dummy.size(); LetterPos++)
+    {
+        //Letters ------------------------
+        if     (text_dummy.at(LetterPos) == 'A')
+        {   
+            initArray(A,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'a')
+        {   
+            initArray(a,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'B')
+        {   
+            initArray(B,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'b')
+        {   
+            initArray(b,5,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'C')
+        {   
+            initArray(C,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'c')
+        {   
+            initArray(c,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'D')
+        {   
+            initArray(D,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'd')
+        {   
+            initArray(d,5,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'E')
+        {   
+            initArray(E,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'e')
+        {   
+            initArray(e,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'F')
+        {   
+            initArray(F,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'f')
+        {   
+            initArray(f,3,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'G')
+        {   
+            initArray(G,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'g')
+        {   
+            initArray(g,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'H')
+        {   
+            initArray(H,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'h')
+        {   
+            initArray(h,5,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'I')
+        {   
+            initArray(I,3,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'i')
+        {   
+            initArray(i,3,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'J')
+        {   
+            initArray(J,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'j')
+        {   
+            initArray(j,3,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'K')
+        {   
+            initArray(K,5,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'k')
+        {   
+            initArray(k,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'L')
+        {   
+            initArray(L,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'l')
+        {   
+            initArray(l,3,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'M')
+        {   
+            initArray(M,5,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'm')
+        {   
+            initArray(m,5,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'N')
+        {   
+            initArray(N,5,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'n')
+        {   
+            initArray(n,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'O')
+        {   
+            initArray(O,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'o')
+        {   
+            initArray(o,5,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'P')
+        {   
+            initArray(P,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'p')
+        {   
+            initArray(p,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'Q')
+        {   
+            initArray(Q,5,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'q')
+        {   
+            initArray(q,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'R')
+        {   
+            initArray(R,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'r')
+        {   
+            initArray(r,3,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'S')
+        {   
+            initArray(S,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 's')
+        {   
+            initArray(s,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'T')
+        {   
+            initArray(T,5,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 't')
+        {   
+            initArray(t,3,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'U')
+        {   
+            initArray(U,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'u')
+        {   
+            initArray(u,5,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'V')
+        {   
+            initArray(V,5,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'v')
+        {   
+            initArray(v,5,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'W')
+        {   
+            initArray(W,5,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'w')
+        {   
+            initArray(w,5,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'X')
+        {   
+            initArray(X,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'x')
+        {   
+            initArray(x,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'Y')
+        {   
+            initArray(Y,5,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'y')
+        {   
+            initArray(y,5,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'Z')
+        {   
+            initArray(Z,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == 'z')
+        {   
+            initArray(z,4,matrix_text);   
+        }
+        // Numbers -----------------------
+        else if(text_dummy.at(LetterPos) == '0')
+        {   
+            initArray(zero,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == '1')
+        {   
+            initArray(one,3,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == '2')
+        {   
+            initArray(two,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == '3')
+        {   
+            initArray(three,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == '4')
+        {   
+            initArray(four,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == '5')
+        {   
+            initArray(five,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == '6')
+        {   
+            initArray(six,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == '7')
+        {   
+            initArray(seven,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == '8')
+        {   
+            initArray(eight,4,matrix_text);   
+        }
+        else if(text_dummy.at(LetterPos) == '9')
+        {   
+            initArray(nine,4,matrix_text);
+        }
+        // Symbols -----------------------
+        else if(text_dummy.at(LetterPos) == '!')
+        {   
+            initArray(exclam,1,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '?')
+        {   
+            initArray(quest,3,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) ==  34)
+        {  
+            initArray(quote,3,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '#')
+        {   
+            initArray(hash,5,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '$')
+        {   
+            initArray(dollar,5,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '%')
+        {   
+            initArray(prcent,7,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '&')
+        {   
+            initArray(_and,5,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '(')
+        {   
+            initArray(round_o,2,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == ')')
+        {   
+            initArray(round_c,2,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '*')
+        {   
+            initArray(star,5,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '+')
+        {   
+            initArray(plus,5,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '-')
+        {   
+            initArray(minus,3,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '=')
+        {   
+            initArray(_equal,3,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == ',')
+        {   
+            initArray(comma,2,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '.')
+        {   
+            initArray(point,1,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '/')
+        {   
+            initArray(slash,5,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) ==  58)
+        {   
+            initArray(d_point,1,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) ==  59)
+        {   
+            initArray(poicom,2,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) ==  95)
+        {   
+            initArray(undlin,4,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) ==  92)
+        {   
+            initArray(b_slash,5,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) ==  64)
+        {   
+            initArray(at,5,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) ==  62)
+        {   
+            initArray(more,4,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) ==  60)
+        {   
+            initArray(less,1,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '[')
+        {   
+            initArray(brack_o,2,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == ']')
+        {   
+            initArray(brack_c,2,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) ==  94)
+        {   
+            initArray(roof,3,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '{')
+        {   
+            initArray(brace_o,3,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '}')
+        {   
+            initArray(brace_c,3,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '~')
+        {   
+            initArray(wave,4,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '|')
+        {   
+            initArray(stick,1,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == '`')
+        {   
+            initArray(frapo,2,matrix_text);
+        }
+        else if(text_dummy.at(LetterPos) == ' ')
+        {   
+            initArray(space,3,matrix_text);
+        }
+    }
+    c_frame += 3;
+}
\ No newline at end of file