3. Advent: Animierte LED-Weihnachtsdeko - UPDATE - AZ-Delivery

Christmas is getting closer and soon we will start decorating our houses. These decorations are mostly static. For example, we decorate the tree with figurines, baubles and tinsel. What if we want to give the decoration a special touch? We could decorate the tree with a canvas showing Christmas greetings and pictures.

As I was thinking about it, it occurred to me that we could do it Times Square (New York) style. It would be very eye-catching with moving greetings and graphics. Well, we have the right components for this project, a WS2812B LED panel with 16x16 LEDs and ATmega microcontroller. With these components, the necessary libraries and a bit of imagination, we will build our little Times Square display. We will show greeting messages in different languages and configure different images. It is fully customizable, so our readers can insert their own images. So let's get started.

Required components and materials

1

Mega 2560 board with ATmega2560 with USB cable

alternatively Microcontroller Board with ATmega328P

1

RGB LED Panel WS2812B 16x16 256 LEDs Flexible Led Matrix IC

1

65pcs jumper wire cable jumpers for breadboard

1

Wood glue

1

Plywood boards

1

Transparent vinyl or thin white paper

 

Software needed

Circuit

Circuit download

The structure is made of materials that can be easily modified, since this is a prototype and we need to make changes until the components are fitted. Using materials such as balsa wood or double corrugated cardboard (as in this project), we can change everything necessary until we get the final dimensions and design with the exact measurements. This way, we can then design the enclosure as a 3D model for a 3D printer.

The shape can be flat, or curved as in our project. For this, we make two semicircles with a radius of 11 cm. Inside these semicircles, we draw another semicircle with a radius of 10.2 cm, concentric to the previous one. In the circumference of these new semicircles, we carve a small groove 1 mm deep and 16 cm long. There we will insert the upper and lower edges of the light panel. The size of the LED panel is 16 cm x 16 cm. So if we insert 1 mm of the panel in the upper and lower circles, we will have a height of 15.8 cm. So we need to vertically connect the upper and lower circles with two "columns" of these dimensions (15.8 cm). The width of the columns can be 3 cm. Once we have installed the panel in the structure, we just need to cover the outer screen with a thin film of translucent plastic (or a material with similar properties). I used a sheet of white paper to do the tests. Already we have our luminous panel ready.

Pay attention to the LED number 0. It must be at the bottom on the right side.

The electronic setup is very simple, as we only need the microcontroller, a few cables and the LED panel. Either we use the one of the Atmega328p or the Mega 2560. I recommend the Mega, since the images used take up a lot of space and we may reach the memory limit. The data line of the LED panel is connected to the microcontroller. As for the power supply, according to the data sheet, with all LEDs in white color and 100% brightness, each LED would consume 0.3 W, which multiplied by the 256 LEDs would result in a total consumption of 76.8 W. At a supply voltage of 5 Vdc, the required current would be 15.36 A. The good news is that we haven't programmed 100% brightness, not all the LEDs are on at the same time, and not all of them are white, so we need a slightly lower power supply. A 2 A or 3 A cell phone charger would be sufficient. I used a lab power supply.

Description of the program flow and the sketch

We show Christmas greetings in different languages scrolling through the picture from the right to the left. Between the greetings we show Christmas pictures.

We must first define matrices with the identification numbers of each LED for displaying images. Then we define a method that contains as many conditions as we define matrices for this image. These conditions go through the numbers of the LEDs in the matrices to configure each LED with the appropriate color and then have them all light up with the configured color. A very simple example is the sock. It has only two colors red and white. For the white LEDs we define the matrix heel[] and as elements of it the identification number of each LED that will light up in white. Similarly for the red LEDs we create the matrix sock_body[].

int heel[] {
    44, 45, 49, 50, 51, 52, 67, 68, 69, 76,
    77, 78, 81, 82, 83, 90, 91, 92, 93, 98,
    99, 100, 108, 109, 110, 113, 114, 115, 124, 125,
    140, 141, 142, 145, 146, 147, 172, 173, 174, 177,
    178, 179, 180, 204, 205
};

int sock_body[] {
    70, 71, 72, 73, 74, 75 , 84, 85, 86, 87,
    88, 89, 101, 102, 103, 104, 105, 106, 107, 116,
    117, 118, 119, 120, 121, 122, 123, 130, 131, 132,
    133, 134, 135, 136, 137, 138, 139, 148, 149, 150,
    151, 152, 153, 154, 155, 156, 157, 162, 163, 164,
    165, 166, 167, 168, 169, 170, 171, 185, 186, 187,
    188, 189, 194, 195, 196, 197, 198, 217, 218, 219,
    220, 229, 228
};

void sock_red_show() {
    FastLED.clear();
    //Heel
    for (int i = 0; i < 45; i++){      
        leds[heel[i]] = CRGB::White;
    }

    //Sock body red
    for (int i = 0; i < 73; i++){      
        leds[sock_body[i]] = CRGB::Red;
    }  
    FastLED.show();
}

Then we define the method sock_red_show()which first turns off all LEDs of the panel and then executes the first condition to show the 45 elements (LEDs) of the heel[]-matrix in white color. Once the last element is configured, the execution of the second condition starts sock_body[]which configures the 73 elements (LEDs) in red color. When it is done with the last element, it executes FastLED.show() is executed. This causes all previously configured LEDs to light up simultaneously with their corresponding colors.

At the beginning of the sketch, as always, the libraries that are needed to use the modules are included. In this case there are four libraries. The FastLED.h-The following three libraries are necessary for the optimal control of the chipset of each LED and for the management of the data and the configuration. The following three libraries are needed to display text. The library Adafruit_GFX.h is needed to display primitive graphics like lines, circles, etc. Since our LED panel is a grid of LEDs, we also include the library Adafruit_NeoMatrix.h library. The last library is Adafruit_NeoPixel.hwhich is needed to control the three internal LEDs of each RGB LED.

#include "FastLED.h"
#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>

NOTE: To Adafruit_NeoMatrix.h the libraries Adafruit_GFX.h and Adafruit_NeoPixel.h must be installed.

Next we create a first constant with the number of LEDs (256) of our panel. A second one to specify the port (9) of the microcontroller to which we connect the data line of the panel.

#define NUM_LEDS 256
#define PIN 9

Then we implement an object with the name matrix from the Adafruit_NeoMatrix.h library to be able to display text on the LED panel. The arguments or parameters we need to specify are:

- Number of LEDs in the width and height of the panel (16 LEDs in the width and 16 LEDs in the height), and the PIN of the microcontroller to which we connected the data line of the panel (9).

- Position of LED number 0 on the panel (the number of LEDs is 256, but the numbering starts from 0 and ends with the number 255); in our panel, LED 0 is located at the bottom right of the panel

- Arrangement of LEDs in the matrix and progression of numbering, LEDs are arranged in columns, i.e. if LED number 0 is in the bottom right corner, LED number 1 is the top one; when it reaches LED number 15 (first column and last LED), the next LED (number 16) is the one to its left, i.e. it would move like a zigzag snake

- The layout and the wiring of the three internal LEDs; the internal layout is green, red and blue LED (NEO_GRB).

- The last parameter is the working frequency (800 KHz)

Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(16, 16, PIN,
                NEO_MATRIX_BOTTOM + NEO_MATRIX_RIGHT +
                NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG,
                NEO_GRB + NEO_KHZ800);

Then we create the variable x, which first stores the number of LEDs the panel has in width. This value is stored with the statement matrix.width() statement. This data has been previously created during the creation of the matrix-object. We will use this variable in a if-statement to count the number of columns we need to move to the left to display a message on the panel. This condition is inside a do-while-loop. We will see the method for displaying the text later.

int x = matrix.width();

We create some matrices representing individual picture elements of an image. The numbers are the corresponding LEDs, over which we can move with a for-loop.

int body[] = {
    66,67,68,90,91,92,93,94,96,97,                      
    98,99,100,101,102,105,106,117,118,119,
    121,125,126,127,128,129,130,136,138,137,
    139,148,150,151,153,154,155,156,157,158,
    159,160,161,162,163,164,165,166,168,170,
    171,180,183,185,187,188,189,191,192,193,
    194,196,197,198,218,219,220,221,222
};

int scarf[] = { 
    57,58,69,70,88,89,103,104,120,122,
    123,124,131,132,133,134,135,152,167,184
};

int nose[] = {
    169,182,201
};

int has[] = { 
    81,82,84,85,107,109,110,111,112,113,
    115,116,140,142,143,144,145,147,149,172,
    174,175,179,181,186,190,195,204
};

int lac[] = { 
    108,114,141,146,173
};

To display the images on the panel, we define an array of data structure type CRGB from the FastLED library. It contains the numbers of each LED on the panel (from number 0 to 255). We will pass these numbers in an array of numbers (which we explained above). We will use them to configure the LEDs with a specific color. This will be explained in more detail in the method for displaying an image.

CRGB leds[NUM_LEDS];

The display of images and texts works separately and independently. Images are displayed using the FastLED.h library. For scrolling text we use the Adafruit libraries. So we need two independent objects for the display on a LED panel.

Once we have completed the library inclusion block, the object implementation and the variable declarations, we will use the setup()-method. The first thing we can see in this method is a pause of 2 seconds. We do this so that when the microcontroller is first turned on or reset, the voltage can be stabilized.

delay(2000);

Next we program the parameters of our LED panel to display the images with the first line FastLED.addLeds. We have to specify the driver chip (WS2812B) of the LEDs, the port of the microcontroller and the arrangement of the three internal RGB LEDs. As parameters for this we pass the name of the CRGB data structure matrix that we use to configure the LEDs and the number of LEDs contained in the panel. In the second line we set the brightness of the LEDs and in the third line we switch off all LEDs of the panel.

FastLED.addLeds<WS2812B, PIN, GRB>(leds, NUM_LEDS); 
FastLED.setBrightness(5);
FastLED.clear();

Now we configure the parameters for displaying the text. We initialize with matrix.begin() the panel. The text starts its display on the right side of the panel and fades out on the left side. With the statement matrix.setTextWrap(false) we prevent the text that disappears on the left side from reappearing on the right side. We set the brightness of the LEDs with a value of 7. The initial color of the text is set with the statement matrix.setTextColor(matrix.Color(Red, Green, Blue)) is set to blue, because both the red and the green LED are completely switched off with a value of 0. The blue LED is switched on with a value of 254.

matrix.begin();
matrix.setTextWrap(false);
matrix.setBrightness(7);
matrix.setTextColor(matrix.Color(0, 0, 254));

We now have the parameters for displaying text and images fully configured and only need to implement the loop() method to bring our Times Square sign to life. In the method loop() we only call methods to display the messages in different languages and images. The pause of three seconds is the time each image is displayed on the screen. In total, there are eight calls to display 8 texts and another 8 calls to display 8 images. Since the respective methods of displaying the text, or the images are similar and only the text and the LEDs that need to light up in color to display the various images differ, I will explain one method of displaying text and one of displaying images.

The first two method calls within the method loop() are:

show_message_az();
snowman_show();
delay(3000);

In the method show_message_az() a do-while-loop is executed. If we remember, the variable x was initially initialized with the number of LEDs the panel is wide, i.e. 16. This loop is executed until the while-condition reaches the x value of -109 (they are negative numbers).

void show_message_az() {
  do {
    
    
    
  } while (x > -110);
}

Within the loop, all LEDs of the panel will be switched on and off with the statement matrix.fillScreen(0) statement. With the second instruction matrix.setTextColor(matrix.Color(254, 0, 0)) we set the text color to red, with matrix.setCursor(x, 5) we set the cursor to column 16 (i.e. the first column is moved 16 positions to the left) and row 5. Then we enter the text with matrix.print(F(" From AZ-Delivery ")) on the panel. With the if-statement we move the text. matrix.show() lets the corresponding LEDs of this position light up. With delay(35) we wait 35 ms. The loop will be executed again from the beginning as long as the value of x is greater than -110. To summarize, configure the color of the text, move the columns and turn on the appropriate LEDs for visualizing each part of the letters of the text, and with a delay of 35 milliseconds give the feeling of the movement of the text.

matrix.fillScreen(0);
matrix.setTextColor(matrix.Color(254, 0, 0));
matrix.setCursor(x, 5);
matrix.print(F(" From AZ-Delivery "));
     
if(--x < -110) {
  x = matrix.width();
}
    
matrix.show();
delay(35);

Now follows the method snowman_show()with which we output the image of a snowman. The first thing we see in this method is the statement FastLED.clear()which turns off all the LEDs on the panel. With the following for-loops, the respective LEDs of the individual image elements are assigned the corresponding color values. With the last instruction FastLED.show() the corresponding image is output on the LED panel.

void snowman_show() {
    FastLED.clear();

    //body
    for (int i = 0; i < 69; i++){
        leds[body[i]] = CRGB::White;
    }

    //scarf
    for (int i = 0; i < 20; i++){
        leds[scarf[i]] = CRGB::Red;
    }

    //nose
    for (int i = 0; i < 3; i++){ 
        leds[nose[i]] = CRGB::Orange;
    }

    //lac
    for (int i = 0; i < 5; i++){
        leds[lac[i]] = CRGB::Blue;
    }

    //hat
    for (int i = 0; i < 28; i++){
        leds[has[i]] = CRGB::Green;
    }
            
    FastLED.show();
}

The other methods for displaying texts and images are built in the same way. Try your own image creations or texts, or create your own case.

I hope to have inspired you with this for a slightly different Christmas decoration and wish you a Merry Christmas.

 

 

DisplaysFür arduinoSpecials

19 comments

Andreas Wolter

Andreas Wolter

@Rose: the ESP uses another core library. If you want to use this microcontroller (nice idea, let me know if it’s work because you can controll it via WiFi or BT), you maybe have to use other libraries. I suggest programming and testing the parts of the code individually. Then I would put everything together. First you have to find out if the FastLED Lib works with ESP.

Regards,
Andreas Wolter
AZ-Delivery Blog

Andreas Wolter

Andreas Wolter

Wir haben ein Update an des Ende des Beitrages angehängt, in dem unser Autor Miguel Torres Gordo die Änderungen für den ATmega328 beschreibt. Schaltplan und Sketch-Download inklusive.

Grüße,
Andreas Wolter
AZ-Delivery Blog

Rose

Rose

Further to my previous post about this project. I am trying to use this sketch on an ESP32 NodeMCU, which has plenty of memory and speed. Unfortunately I have just gone crashing into a new problem which I can’t fix. By commenting out various bits of code and many many uploads, I have found the sketch will work fine through “void snowman_show” until you get to the bottom of that function which is “FastLED.show”, it then hangs up showing a fault in the FastLED.h library at line 67. I have spent hours trawling the internet, trying to find an explanation for this, without any success.

Can anyone please explain how to fix this. Thank you.

Error 1 “Documents\Arduino\libraries\FastLED\src/FastLED.h:67”

Error 2 “No hardware SPI pins defined. All SPI access will default to bitbanged output”

Any help would be gratefully received. Thank you.

Dave.

Michael Ahrens

Michael Ahrens

Auch von mir alles Gute im neuen Jahr.
Ich habe die gleiche Erfahrung wie Peter Tepass gemacht. Der Einsatz eines 2560 brachte das gewünschte Ergebnis. Leider war er vor Weihnachten bei AZ-Delivery nicht lieferbar.
@Andreas Wolter: Das Blogbeiträge der Inspiration dienen ist sicher ok. Die Aussage, dass Shopartikel nicht mit den Blogartikeln verknüpft sind, mag auch stimmen. Im konkreten Fall wurde aber gerade der Shopartikel im Zusammenhang mit dem Blog-Beitrag beworben. Und da würde sicher nicht nur ich erwarten, dass die beworbenen Artikel bei bestimmungsgemäßen Einsatz auch zum gewünschten Ergebnis führen.

Andreas Wolter

Andreas Wolter

@Peter Tepaß: auch an dieser Stelle sorry, dass es nicht funktioniert wie erwartet. Die Blogbeiträge sind nicht mit den Shopartikeln verknüpft. Sie dienen lediglich zur Inspiration, eigene Projekte zu basteln, oder auch Neues zu lernen. Das Projekt ist vorrangig für den größeren ATmega gedacht. Für den ATmega328p muss der Code umgeschrieben werden. Warum der Rolltext auf dem 328 nicht funktioniert, kann ich nicht sagen. Ich werde den Autoren kontaktieren und fragen, ob er das Projekt für den 328 ändern und herausfinden kann, woran das mit dem Rolltext liegt. Wir finden sicher eine Lösung.

Mit freundlichen Grüßen,
Andreas Wolter
AZ-Delivery Blog

Peter Tepaß

Peter Tepaß

Zunächst einmal wünsche ich allen einen guten Start in das Jahr 2023!

Durch die Verminderung der anzuzeigenden Grafiken und Texte konnte ich den Speicherbedarf soweit reduzieren, dass das fehlerfreie Kompilieren und das Upload auf den ATmega328 möglich ist. Dann zeigt sich jedoch, dass nur die Grafiken angezeigt werden und nicht die laufenden Texte. (siehe auch andere Kommentare!) Erst, wenn im setup()-Bereich die 3 Zeilen mit “FastLED. …” auskommentiert werden, erscheint der Fließtext, aber natürlich keine Grafik mehr.

Da mir auch einen ATmega2560 zur Verfügung steht, habe ich den kompletten Sketch “led_panel_christmas.ino” auf dieser Baugruppe erfolgreich hochladen können. Zu meiner Verblüffung funktioniert alles, wie beschrieben. Es werden alle Bilder und Texte abwechselnd ohne Probleme dargestellt!

Somit muss ich daraus folgern, dass weitere Unterschiede zwischen dem ATmega328 aus dem Kit und dem ATmega2560 existieren. Hier haben wohl die Käufer des Kits “3. Advent” bei AZ-Delivery die Probleme geliefert bekommen. Wie geschrieben wurde hierzu von Mir und den anderen Zeit investiert und nur Frust “geerntet”, da das Programm nicht mit dem ATmega328 lauffähig ist. Die gleichzeitige Anzeige der Texte und Grafiken funtioniert jedenfalls nicht. Vielleicht kann hier AZ-Delivery die Zufriedenheit ihrer Kunden mit einem Austausch der ATmega328 gegen ATmega2560 verbessern? Alternativ kann natürlich aich ein lauffähiger Lösungsvorschlag zum ATmega328 mit der wechselnden Anzeige von Grafiken und Texten erfolgen.
Mit besten Grüßen,
Peter Tepaß

Andreas Wolter

Andreas Wolter

wenn Sie einen Mikrocontroller mit weniger Programmspeicher verwenden, müssten Sie den Quellcode anpassen und weniger Bilder auf dem Display anzeigen.

Ganz allgemein dienen die Blogbeiträge als Inspiration zum Selberbasteln. Auch wenn Beiträge mit den Shopartikeln verknüpft werden. Manchmal sind auch die Komponenten, die in den den Artikeln verwendet werden, nicht im Shop verfügbar, weswegen andere Artikel als Alternative verknüpft werden.

Grüße,
Andreas Wolter
AZ-Delivery Blog

Peter Tepaß

Peter Tepaß

Auch ich war von der Idee begeistert. Bei der Umsetzung stolpere ich aber auch von einem Problem zum anderen.
Inzwischen kann ich aber auch die led_panel_christmas.ino Kompilieren. Erhalte natürlich bei dem Board “Arduino Uno” mit dem ATmega328 die folgende Fehlermeldung:
Nicht genug Arbeitsspeicher; unter https://support.arduino.cc/hc/en-us/articles/360013825179 finden sich Hinweise, um die Größe zu verringern.
Der Sketch verwendet 16522 Bytes (51%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 2887 Bytes (140%) des dynamischen Speichers, -839 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
Datenbereich überschreitet den verfügbaren Platz auf der Platine
Compilation error: Datenbereich überschreitet den verfügbaren Platz auf der Platine

Was muss ich denn nun ändern, damit der Blog-Beitrag von AZ-Delivery auf dem gelieferten Set von AZ-Delivery läuft?
Beste Grüße,
Peter Tepaß

Dave Rose

Dave Rose

I found that you had to comment out all of ‘show graphics’ otherwise what you see is the first message then the sketch ‘locks up’. With the graphics out, all of the messages loop absolutely fine. I have not yet found the error that is preventing the graphics from showing. Can anyone please help with this and get this sketch working correctly and in full. Thank you.

Frank Reil

Frank Reil

Upload funktioniert bei Auswahl von Arduino Uno im Board Manager. Der mitgelieferte Arduino Uno hat allerdings wohl zuwenig Speicherplatz für die globalen Variablen im Sketch.

Frank

Frank

Habe das gleiche Problem wie Michael Ahrens. Als Board ist “Arduino Mega or Mega 2560” ausgewählt, ebenso der korrekte Port (laut Device Manager. Im Library Manager habe ich alle fehlenden Libraries heruntergeladen. Auffällig ist, das die rote On-Board-LED “L” unablässig blinkt. Habe noch nicht herausfinden können, was das bedeutet.

Michael Ahrens

Michael Ahrens

Die Software habe ich nochmals runtergeladen und etwas experimentiert. Aus meiner laienhaften Sicht reicht der Speicherplatz des dem 3.Advent Kit beigelegten Atmega328 nicht zur Ausführung. Dies wird ja im Blog angedeutet. Daher vermutlich auch die Probleme beim Hochladen.
Werden die Bilder reduziert und der Speicherbedarf unterschreitet den Grenzwert, ist das Hochladen erfolgreich. Trotzdem funktioniert der Sketch nicht wie gewünscht: Entweder werden nur die Bilder angezeigt oder nur die Fliesstexte. Kommentiere ich alle Bilder aus, werden alle Texte zur Anzeige gebracht. Sobald mindestens ein Bild angezeigt werden soll, wird kein einziger Text eingeblendet. Der Wechsel zwischen den Bildern funktioniert. Vom zeitlichen Abstand bis zum Wechsel der Bilder, ist davon auszugehen, dass dies die Zeit ist, die für die Textdarstellungen benötigt wird. Warum die Textanzeige in dieser Konstellation nicht funktioniert, ist mir rätselhaft.

Andreas Wolter

Andreas Wolter

@Michael Ahrens: im Abschnitt “Benötigte Software” finden Sie den Link zu led_panel_christmas.ino
Ich werde ihn zusätzlich weiter unten noch einmal einfügen.

Grüße,
Andreas Wolter
AZ-Delivery Blog

Michael Ahrens

Michael Ahrens

Hallo,

die INO-Datei habe ich im Eifer des Gefechts übersehen. Jetzt heruntergeladen und versucht auf das Board aus dem 3. Advents Kit aufzuspielen. Leider ohne Erfolg. Beim Hochladen kommt es zum Fehler

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: stk500v2_getsync(): timeout communicating with programmer

USB Kabel gewechselt, andere Ports versucht auch alle kein Erfolg

Michael Ahrens

Michael Ahrens

@Andreas Wolter: Einen Link zum Download des gesamten Programms konnte ich leider nicht finden. Der Code wurde per Copy/Paste aus dem Blog übernommen.

Andreas Wolter

Andreas Wolter

@Bahner56: es liest sich so, als hätten Sie den Quellcode verändert. Funktioniert denn der originale Quellcode, wenn Sie ihn herunterladen und so auf den MC hochladen?

Grüße,
Andreas Wolter
AZ-Delivery Blog

Andreas Wolter

Andreas Wolter

@Michael Fischer: die Funktion FastLED.show() wird immer aufgerufen, nachdem die LEDs zur Anzeige konfiguriert wurden. Hier besteht eine Grafik aus verschiedenen Elementen. Jede LED-Gruppe wird konfiguriert und dann mit .show() angezeigt. Wenn das alles sehr kurz hintereinander passiert, sieht man dank der Trägheit des menschlichen Auges nicht das aufeinander folgende Aufleuchten der verschiedenen LED-Gruppen. Lässt man das Kommando zwischendurch weg und ruft es nur am Ende auf, werden alle konfigurierten LED-Gruppen gleichzeitig zum Leuchten gebracht. Beides geht wohl. Damit es keine Speicherprobleme gibt, sollte der empfohlene Mega2560 verwendet werden, der etwas mehr Speicher mitbringt, als die MCs mit ATmega328.

Grüße,
Andreas Wolter

Bahner56

Bahner56

Ich fand die Idee auch sehr gut und habe das Programm erstmal zum Testen erstellt. Die Bilder funktionieren auf Anhieb einwandfrei. Nur leider wird der Text nicht angezeigt. Die erforderlichen Bibliotheken sind eingebunden. Folgender Code zum Anzeigen des Textes ist bei mir implementiert:

in der Loop-Schleife:

show_message_1();

Die zugehörige Funktion:

void show_message_1() {
int i=1;
Serial.println(i);
do {
int j=2;
Serial.println(j);
matrix.fillScreen(0);
matrix.setTextColor(matrix.Color(254, 0, 0));
matrix.setCursor(x, 5);
matrix.print(F("From AZ-Delivery "));

if(—x < -110) {
x = matrix.width();
}

matrix.show();
delay(35);
} while (x > -110);
i=i++;
Serial.println(i);
}

Die Print-Anweisungen habe ich eingefügt, um zu prüfen, ob der Code überhaupt ausgeübt wird. Das ist der Fall. Eine Anzeige des Textes erfolgt jedoch nicht. Ich kann mir nicht erklären, woran das liegt.

Michael Fischer

Michael Fischer

Tolle Idee, ich musste am Anfang etwas experimentieren um den Sketch mit meinem Uno Zero zum Laufen zu bringen. Aber Pin 3 hat dann zum erwünschten Ergebnis geführt. Alle andren Prozessoren die ich hatte haben nicht genügend Speicherplatz.
Mit manchen der Grafiken gabs ein Problem. In den Methoden zur Anzeige stand hinter jeder Farbdefinition ein FastLED.show();
Das führt wohl dazu das die Grafiken nur manchmal richtig wiedergegeben werden. Ich durchschaue nicht wirklich warum aber ich bin auch nicht soi der Held in der Analyse der Bibliotheken.
Wenn ich diese Befehle in der Zeile 343,349,391,438 und 444 auskommentiere geht es hervorragend. Danke für die Super Idee

Leave a comment

All comments are moderated before being published

Recommended blog posts

  1. ESP32 jetzt über den Boardverwalter installieren - AZ-Delivery
  2. Internet-Radio mit dem ESP32 - UPDATE - AZ-Delivery
  3. Arduino IDE - Programmieren für Einsteiger - Teil 1 - AZ-Delivery
  4. ESP32 - das Multitalent - AZ-Delivery