- 3D-Druck Einstieg und Tipps         
Ergebnis 1 bis 10 von 10

Thema: Arduino LED Matrix

  1. #1
    Neuer Benutzer Öfters hier
    Registriert seit
    06.01.2015
    Beiträge
    10

    Arduino LED Matrix

    Anzeige

    Praxistest und DIY Projekte
    Hallo zusammen,

    Ich versuche gerade eine 8x8 LED Matrix ans laufen zu bringen, damit ich deine "Laufschrift" erzeugen kann. Ich habe mich einfach mal an dieser Idee orientiert:

    http://www.instructables.com/id/LED-...ay-1/?ALLSTEPS

    Aber irgendwie funktioniert der ganze Spass nicht.

    Ich benutze:

    - 2x 74HC595N
    - 1x ULN2803A
    - Arduino Uno
    - LED Matrix 1588BS

    Die Transistoren hab ich (noch) nicht. Aber an denen kann es ja nicht liegen das so gar nichts hinhaut.

    Also falls imd eine Idee hat was ich da falsch mache, ich brauche Hilfe

    Hab mal ein Foto dran gehangen... auch wenn man nicht wirklich den verlauf der Kabel sieht

    Klicke auf die Grafik für eine größere Ansicht

Name:	Foto.jpg
Hits:	31
Größe:	65,4 KB
ID:	29593

  2. #2
    Erfahrener Benutzer Robotik Einstein Avatar von Geistesblitz
    Registriert seit
    15.03.2011
    Ort
    Dresden
    Alter
    36
    Beiträge
    1.937
    Sag doch erstmal, was es macht, was es nicht soll. Leuchten tuts ja schonmal, aber anscheinend nicht richtig? Wird das Muster nicht angezeigt? Paar mehr Infos wären gut.
    AI - Artificial Idiocy

  3. #3
    Neuer Benutzer Öfters hier
    Registriert seit
    06.01.2015
    Beiträge
    10
    Also:

    Ich habe eine Laufschrift auf der Matrix erzeugt, nur ohne shift register. ganz einfach mit 16 kabeln aus dem arduino raus und mit 8 Widerständen davor in die matrix rein... klappt super.

    Jetzt würde ich gerne die beschriebenen shiftregister nutzen. ich habe dazu 2 codes im Binet gefunden und eine Beschreibung zum verkabeln. nur das klappt leider nicht. und jetzt frage ich mich wo ich beim verkabeln was falsch mache, bzw ob ich überhaupt die richtigen Bauteile benutze.

    also meine frage: hat jmd eine Lautschrift mit shift register gemacht und kann mich dazu briefen?


    Das ganze Soll ein Projekt für die FH werden, zur not kann ich das ganze auch ohne shiftregister machen, aber ich habe halt vorher gesagt das ich das auch mit shiftregistern schaffe(multiplexing)
    Geändert von Martorinho (06.01.2015 um 19:19 Uhr)

  4. #4
    Erfahrener Benutzer Roboter Genie
    Registriert seit
    02.09.2009
    Ort
    Berlin (Mariendorf)
    Beiträge
    1.023
    Zitat Zitat von Martorinho Beitrag anzeigen
    Die Transistoren hab ich (noch) nicht. Aber an denen kann es ja nicht liegen das so gar nichts hinhaut.
    Wie kommst du zu diesem Schluss? Hast du sie einfach weggelassen? Oder die Schaltung verändert? Dann zeig bitte deinen tatsächlichen Schaltplan.

    Wenn du mit dieser Nachbau-Bastelei auf die nächste Maker Faire gehen willst können wir dir hier gerne helfen.

    Wenn das aber ein Projekt auf deinem Weg zum Bachelor oder Diplom sein soll, dann empfehle ich dir wärmstens, daran das strukturierte Erarbeiten von technischen Grundlagen zu üben. Und das geht nicht, indem du uns deine Scherben vor die Füße wirfst und bettelst: Helft mir doch, das Zeug irgendwie zum laufen zu kriegen.

    Wenn du _wirklich_ was lernen willst auf diesem Gebiet, dann mach ein Projekt für dich draus und recherchiere, wie das Schiftregister, das Transistorarray, der Transistor und die Programmierung des Arduino funktionieren und zusammenwirken. Und wundere dich nicht, wenn du im Anfangen merkst, dass das viel umfangreicher ist als man auf den ersten und zweiten Blick ahnt.

    Dann stelle hier konkrete Fragen. Die wird man dir bereitwillig beantworten und du wirst weit mehr lernen als auf dem bisher eingeschlagenen Weg.

    Ein konstruktiver Tip dennoch: Bau für den Anfang Vorwiderstände ein, die einen statischen Betrieb der Matrix erlauben, ohne die LEDs zu schädigen. Damit kannst du die Wirkungender Programmierung erproben. Im Multiplex wird die Matrix dann zwar zu dunkel sein. Das wird mit wohlüberlegter Reduzierung der Vorwiderstände ausgeglichen - aber erst, wenn der Multiplex wirklich rund läuft.


    @Geistesblitz
    Ich will deine Geduld und Hilfsbereitschaft nicht schlecht reden.

  5. #5
    Neuer Benutzer Öfters hier
    Registriert seit
    06.01.2015
    Beiträge
    10
    Also erstmal danke. und ja, da hast du vollkommen recht. aber ich werde nie wieder was mit c programmieren und der arduino zu tun haben und ich will einfach nur das es funktioniert.

    jetzt habe ich auch einen code, bei dem man aber leider nur im code selber die "message" eingeben kann.

    in dem char "requestString[] " wird ja einfach ein wort gespeichert. jetzt wäre es sehr schön, wenn ich über den serial.monitor was eingeben kann, das dann in requestString[] gespeichert wird. aber Serial.read klappt ja leider nicht bei arrays....

    im folgenden der code:


    Code:
    int speed = 20; //number of times to repeat each frame
    int pauseDelay = 500; //microseconds to leave each row on before moving to the next
    
    char requestString[] = " blablabla " //The string to display
    //to change the message in code you right yourself simply 
    //change this data and reset index and offset to 0
    //Variables used for scrolling (both start at 0
    int index = 0; //this is the current charachter in the string being displayed
    int offset = 0; //this is how many columns it is offset by
    
    //Pin Definitions
    int rowA[] = {9,8,7,6,5,4,3,2}; //An Array defining which pin each row is attached to
    //(rows are common anode (drive HIGH))
    int colA[] = {17,16,15,14,13,12,11,10}; //An Array defining which pin each column is attached to
    //(columns are common cathode (drive LOW))
    
    //Constants defining each charachters position in an array of integer arrays
    //Letters
    const int A = 0; const int B = 1; const int C = 2; const int D = 3; const int E = 4;
    const int F = 5; const int G = 6; const int H = 7; const int I = 8; const int J = 9; 
    const int K = 10; const int L =11; const int M = 12; const int N = 13; const int O = 14; 
    const int P = 15; const int Q =16; const int R = 17; const int S = 18; const int T = 19; 
    const int U = 20; const int V =21; const int W = 22; const int X = 23; const int Y = 24; 
    const int Z = 25;
    
    //Punctuation
    const int COL =26; const int DASH = 27; const int BRA2 = 28; const int _ = 29; const int LINE = 34;
    const int DOT =36;
    
    //Extra Charchters
    const int FULL =30; const int CHECK = 31; const int B2 = 32; const int TEMP = 33; 
    const int SMILE =35; const int COLDOT = 36;
    
    
    //The array used to hold a bitmap of the display 
    //(if you wish to do something other than scrolling marque change the data in this
    //variable then display)
    byte data[] = {0,0,0,0,0,0,0,0}; 
    
    //The alphabet
    //Each Charachter is an 8 x 7 bitmap where 1 is on and 0 if off
    const int _A[] = {B0001000,
    B0010100,
    B0100010,
    B1000001,
    B1111111,
    B1000001,
    B1000001,
    B0000000};
    
    const int _B[] = {B1111110,
    B0100001,
    B0100001,
    B0111110,
    B0100001,
    B0100001,
    B1111110,
    B0000000};
    
    const int _C[] = {B0011111,
    B0100000,
    B1000000,
    B1000000,
    B1000000,
    B0100000,
    B0011111,
    B0000000};
    
    const int _D[] = {B1111100,
    B0100010,
    B0100001,
    B0100001,
    B0100001,
    B0100010,
    B1111100,
    B0000000};
    
    const int _E[] = {B1111111,
    B1000000,
    B1000000,
    B1111100,
    B1000000,
    B1000000,
    B1111111,
    B0000000};
    
    const int _F[] = {B1111111,
    B1000000,
    B1000000,
    B1111100,
    B1000000,
    B1000000,
    B1000000,
    B0000000};
    
    const int _G[] = {B0011111,
    B0100000,
    B1000000,
    B1001111,
    B1000001,
    B0100001,
    B0011111,
    B0000000};
    
    const int _H[] = {B1000001,
    B1000001,
    B1000001,
    B1111111,
    B1000001,
    B1000001,
    B1000001,
    B0000000};
    
    const int _I[] = {B1111111,
    B0001000,
    B0001000,
    B0001000,
    B0001000,
    B0001000,
    B1111111,
    B0000000};
    
    const int _J[] = {B0001111,
    B0000001,
    B0000001,
    B0000001,
    B0000001,
    B1000001,
    B0111110,
    B0000000};
    
    const int _K[] = {B1000011,
    B1000100,
    B1001000,
    B1110000,
    B1001000,
    B1000100,
    B1000011,
    B0000000};
    
    const int _L[] = {B1000000,
    B1000000,
    B1000000,
    B1000000,
    B1000000,
    B1000000,
    B1111111,
    B0000000};
    
    const int _M[] = {B1110110,
    B1001001,
    B1001001,
    B1001001,
    B1001001,
    B1001001,
    B1001001,
    B0000000};
    
    const int _N[] = {B1000001,
    B1100001,
    B1010001,
    B1001001,
    B1000101,
    B1000011,
    B1000001,
    B0000000};
    
    const int _O[] = {B0011100,
    B0100010,
    B1000001,
    B1001001,
    B1000001,
    B0100010,
    B0011100,
    B0000000};
    
    const int _P[] = {B1111110,
    B0100001,
    B0100001,
    B0111110,
    B0100000,
    B0100000,
    B0100000,
    B0000000};
    
    const int _Q[] = {B0011100,
    B0100010,
    B1000001,
    B1000001,
    B1000101,
    B0100010,
    B0011101,
    B0000000};
    
    const int _R[] = {B1111110,
    B0100001,
    B0100001,
    B0101110,
    B0100100,
    B0100010,
    B0100001,
    B0000000};
    
    const int _S[] = {B0111111,
    B1000000,
    B1000000,
    B0111110,
    B0000001,
    B0000001,
    B1111110,
    B0000000};
    
    const int _T[] = {B1111111,
    B0001000,
    B0001000,
    B0001000,
    B0001000,
    B0001000,
    B0001000,
    B0000000};
    
    const int _U[] = {B1000001,
    B1000001,
    B1000001,
    B1000001,
    B1000001,
    B1000001,
    B0111110,
    B0000000};
    
    const int _V[] = {B1000001,
    B1000001,
    B1000001,
    B1000001,
    B0100010,
    B0010100,
    B0001000,
    B0000000};
    
    const int _W[] = {B1000001,
    B1001001,
    B1001001,
    B1001001,
    B1001001,
    B1001001,
    B0110110,
    B0000000};
    
    const int _X[] = {B1000001,
    B0100010,
    B0010100,
    B0001000,
    B0010100,
    B0100010,
    B1000001,
    B0000000};
    
    const int _Y[] = {B1000001,
    B0100010,
    B0010100,
    B0001000,
    B0001000,
    B0001000,
    B0001000,
    B0000000};
    
    const int _Z[] = {B1111111,
    B0000010,
    B0000100,
    B0111110,
    B0010000,
    B0100000,
    B1111111,
    B0000000};
    
    const int _COL[] = {B0000000,
    B0011000,
    B0011000,
    B0000000,
    B0011000,
    B0011000,
    B0000000,
    B0000000};
    
    const int _DASH[] = {B0000000,
    B0000000,
    B0000000,
    B0111110,
    B0000000,
    B0000000,
    B0000000,
    B0000000};
    
    const int _BRA2[] = {B0010000,
    B0001000,
    B0000100,
    B0000100,
    B0001000,
    B0010000,
    B0000000,
    B0000000}; 
    
    const int __[] = {B0000000,
    B0000000,
    B0000000,
    B0000000,
    B0000000,
    B0000000,
    B0000000,
    B0000000};
    
    const int _FULL[] = {B1111111,
    B1111111,
    B1111111,
    B1111111,
    B1111111,
    B1111111,
    B1111111,
    B0000000}; 
    
    const int _CHECK[] = {B1010101,
    B0101010,
    B1010101,
    B0101010,
    B1010101,
    B0101010,
    B1010101,
    B0000000};
    
    const int _B2[] = {B0111110,
    B0000001,
    B0000001,
    B0001111,
    B0000001,
    B1000001,
    B0111110,
    B0000000};
    
    const int _TEMP[] = {B0000011,
    B0011111,
    B0111111,
    B1111110,
    B1111111,
    B0011111,
    B0000011,
    B0000000};
    
    const int _LINE[] = {B0000001,
    B0000001,
    B0000001,
    B0000001,
    B0000001,
    B0000001,
    B0000001,
    B0000000}; 
    
    const int _SMILE[] = {B000000,
    B1100100,
    B1100010,
    B0011001,
    B1100010,
    B1100100,
    B0000000,
    B0000000}; 
    
    
    const int _DOT[] = {B0000000,
    B0000000,
    B0000000,
    B0000000,
    B1100000,
    B1100000,
    B0000000,
    B0000000}; 
    
    const int _COLDOT[] = {B0000000,
    B0110000,
    B0110000,
    B0000000,
    B0110011,
    B0110011,
    B0000000,
    B0000000}; 
    
    //Load the bitmap charachters into an array (each charachters position corresponds to its previously defined index (ie _A (a's bitmap) 
    //is at index 0 and A = 0 so letters[A] will return the 'A' bitmap)
    const int* letters[] = {_A,_B,_C,_D,_E,_F,_G,_H,_I,_J,_K,_L,_M,_N,_O,_P,_Q,_R,_S,_T,_U,_V,_W,_X,_Y,_Z,_​COL,_DASH,_BRA2,__, _FULL, _CHECK, _B2, _TEMP, _LINE, _SMILE, _DOT, _COLDOT};
    
    //Setup runs once when power is applied
    void setup()
    { 
    for(int i = 0; i <8; i++){ //Set the 16 pins used to control the array as OUTPUTs
    pinMode(rowA[i], OUTPUT);
    pinMode(colA[i], OUTPUT);
    Serial.begin(9600);
    }
    }
    
    //repeats 
    void loop()
    {
    updateMatrix();
    }
    
    
    
    void updateMatrix(){
    loadSprite();
    showSprite(speed);
    }
    
    
    //An array holding the powers of 2 these are used as bit masks when calculating what to display
    const int powers[] = {1,2,4,8,16,32,64,128};
    
    //Loads the current scroll state frame into the data[] display array
    void loadSprite(){
    int currentChar = getChar(requestString[index]);
    int nextChar = getChar(requestString[index+1]);
    
    for(int row=0; row < 8; row++){ //iterate through each row
    data[row] = 0; //reset the row we're working on
    for(int column=0; column < 8; column++){ //iterate through each column
    data[row] = data[row] + ((powers[column] & (letters[currentChar][row] << offset))); //loads the current charachter offset by offset pixels 
    data[row] = data[row] + (powers[column] & (letters[nextChar][row] >> (8-offset) )); //loads the next charachter offset by offset pixels
    }
    }
    offset++; //increment the offset by one row
    if(offset==8){offset = 0; index++; if(index==sizeof(requestString)-2){index=0;}} //if offset is 8 load the next charachter pair for the next time through
    }
    
    void showSprite(int speed2){
    for(int iii = 0; iii < speed2; iii++){ //show the current frame speed2 times
    for(int column = 0; column < 8; column++){ //iterate through each column
    for(int i = 0; i < 8; i++){ 
    digitalWrite(rowA[i], LOW); //turn off all row pins 
    }
    for(int i = 0; i < 8; i++){ //Set only the one pin
    if(i == column){ digitalWrite(colA[i], LOW);} //turns the current row on
    else{ digitalWrite(colA[i], HIGH); }//turns the rest of the rows off
    }
    
    for(int row = 0; row < 8; row++){ //iterate through each pixel in the current column
    int bit = (data[column] >> row) & 1;
    if(bit == 1){ 
    digitalWrite(rowA[row], HIGH); //if the bit in the data array is set turn the LED on
    }
    
    }
    delayMicroseconds(pauseDelay); //leave the column on for pauseDelay microseconds (too high a delay causes flicker)
    } 
    }
    }
    
    //returns the index of a given charachter
    //for converting from a string to a lookup in our array of charachter bitmaps
    int getChar(char charachter){
    int returnValue = Z;
    switch(charachter){
    case 'A': returnValue = A; break;
    case 'a': returnValue = A; break;
    case 'B': returnValue = B; break;
    case 'b': returnValue = B; break;
    case 'C': returnValue = C; break;
    case 'c': returnValue = C; break;
    case 'D': returnValue = D; break;
    case 'd': returnValue = D; break;
    case 'E': returnValue = E; break;
    case 'e': returnValue = E; break;
    case 'F': returnValue = F; break;
    case 'f': returnValue = F; break;
    case 'G': returnValue = G; break;
    case 'g': returnValue = G; break;
    case 'H': returnValue = H; break;
    case 'h': returnValue = H; break;
    case 'I': returnValue = I; break;
    case 'i': returnValue = I; break;
    case 'J': returnValue = J; break;
    case 'j': returnValue = J; break;
    case 'K': returnValue = K; break;
    case 'k': returnValue = K; break;
    case 'L': returnValue = L; break;
    case 'l': returnValue = L; break;
    case 'M': returnValue = M; break;
    case 'm': returnValue = M; break;
    case 'N': returnValue = N; break;
    case 'n': returnValue = N; break;
    case 'O': returnValue = O; break;
    case 'o': returnValue = O; break;
    case 'P': returnValue = P; break;
    case 'p': returnValue = P; break;
    case 'Q': returnValue = Q; break;
    case 'q': returnValue = Q; break;
    case 'R': returnValue = R; break;
    case 'r': returnValue = R; break;
    case 'S': returnValue = S; break;
    case 's': returnValue = S; break;
    case 'T': returnValue = T; break;
    case 't': returnValue = T; break;
    case 'U': returnValue = U; break;
    case 'u': returnValue = U; break;
    case 'V': returnValue = V; break;
    case 'v': returnValue = V; break;
    case 'W': returnValue = W; break;
    case 'w': returnValue = W; break;
    case 'X': returnValue = X; break;
    case 'x': returnValue = X; break;
    case 'Y': returnValue = Y; break;
    case 'y': returnValue = Y; break;
    case 'Z': returnValue = Z; break;
    case 'z': returnValue = Z; break;
    case ' ': returnValue = _; break;
    case '3': returnValue = B2; break;
    case '<': returnValue = TEMP; break;
    case '*': returnValue = FULL; break;
    case '|': returnValue = LINE; break; 
    case '_': returnValue = _; break; 
    case ':': returnValue = COL; break; 
    case '-': returnValue = DASH; break; 
    case ')': returnValue = BRA2; break; 
    case '%': returnValue = SMILE; break; 
    case '.': returnValue = DOT; break; 
    case '^': returnValue = COLDOT; break; 
    }
    return returnValue;
    }
    Geändert von Martorinho (07.01.2015 um 17:26 Uhr)

  6. #6
    Erfahrener Benutzer Roboter Genie
    Registriert seit
    02.09.2009
    Ort
    Berlin (Mariendorf)
    Beiträge
    1.023
    Zitat Zitat von Martorinho Beitrag anzeigen
    ... ich werde nie wieder was mit c programmieren und der arduino zu tun haben und ich will einfach nur das es funktioniert
    Wenn das so ist, kann ich das verstehen. Der Overhead ist ja ganz beachlich. Ich hab halt ein E-Technik-Studium angenommen bei einer solchen Aufgabe.

    Zum Code selbst kann ich aber nicht viel beitragen, aber bitte, bitte: mach Code-Tags in eckigen Klammern (siehe Menü des Editors; das kannst nur DU ändern) vor und hinter deinen Code, sonst schreckt das Hilfswillige ab, weil es unübersichtlich wird.

    Willst du sehr langen variablen Text anzeigen lassen, also mehr als in den Speicher des Arduino reinpasst? Dann müsste man das irgendwie rollierend gestalten.
    Serielles einlesen und speichern als Matrix schließen sich doch nicht grundsätzlich aus. Wo siehst du da ein Problem?

  7. #7
    Neuer Benutzer Öfters hier
    Registriert seit
    06.01.2015
    Beiträge
    10
    war das so gemeint mit den klammern?

    zum problem:

    ein kurzer text reicht. es geht hier nur um ein paar Zeichen. ich weiss auch wie ich über serial.read einer variablen das im monitor eigegebene zuweise, aber halt nicht, wie hier, bei einem char array. Ich weiss nicht wie ich die "zeichenkette" vom serial monitor in das array schreiben soll.

  8. #8
    Erfahrener Benutzer Roboter-Spezialist Avatar von witkatz
    Registriert seit
    24.05.2006
    Ort
    NRW
    Alter
    53
    Beiträge
    540
    Blog-Einträge
    17
    Aus dem Bauch heraus etwa so:
    Code:
    static int i = 0;    // Zählvariable
    if (Serial.available() > 0) {
        requestString[i] = Serial.read();
        i++;
        if(i > 10) // i > max. Array-Index von requestString?
        {
            i = 0;
        }
    }

  9. #9
    Neuer Benutzer Öfters hier
    Registriert seit
    06.01.2015
    Beiträge
    10
    ok, und das soll dann in den loop?

  10. #10
    Erfahrener Benutzer Roboter-Spezialist Avatar von witkatz
    Registriert seit
    24.05.2006
    Ort
    NRW
    Alter
    53
    Beiträge
    540
    Blog-Einträge
    17
    Zitat Zitat von Martorinho Beitrag anzeigen
    ok, und das soll dann in den loop?
    Es ist ein Lösungsansatz für den Zugriff auf das char-Array, den du erbeten hast. Die Lösung musst du dir selber erarbeiten, sprich - den Codeschnipsel verstehen, an dein Programm anpassen, an der richtigen Stelle einfügen und testen.

Ähnliche Themen

  1. Arduino Mega Matrix
    Von oel im Forum Arduino -Plattform
    Antworten: 16
    Letzter Beitrag: 04.10.2014, 16:11
  2. 8X8 Matrix mit Arduino zum duchlaufen bringen
    Von PatrickHH im Forum Software, Algorithmen und KI
    Antworten: 4
    Letzter Beitrag: 12.07.2014, 07:36
  3. LED Matrix mit Arduino ansteuern?
    Von robots4-ever im Forum Elektronik
    Antworten: 2
    Letzter Beitrag: 01.03.2012, 07:56
  4. LED Matrix
    Von Tanne123 im Forum Vorstellung+Bilder+Ideen zu geplanten eigenen Projekten/Bots
    Antworten: 3
    Letzter Beitrag: 13.10.2010, 22:20
  5. LED Matrix
    Von .Johannes. im Forum Elektronik
    Antworten: 5
    Letzter Beitrag: 30.08.2006, 21:29

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •  

LiFePO4 Speicher Test