Herzlichen Glückschwamm.
So ist das...
Ein erster Versuch.
Aber ohne die zwei Headerdateien mach ich dann auch nicht mehr weiter.
#include <FastLED.h>
#include <LEDMatrix.h>
#include <LEDText.h>
#include <storming.h> // Schriftart 1
#include <odinson.h> // Schriftart 2
// Change the next 6 defines to match your matrix type and size
#define LED_PIN 2
#define COLOR_ORDER GRB
#define CHIPSET WS2812B
#define MATRIX_WIDTH -32
#define MATRIX_HEIGHT 8
#define MATRIX_TYPE VERTICAL_ZIGZAG_MATRIX
cLEDMatrix<MATRIX_WIDTH, MATRIX_HEIGHT, MATRIX_TYPE> leds;
cLEDText ScrollingMsg; // Laufschrift 1
// Laufschrift 2
const unsigned char TxtDemo[] = // Text 1, und die Effekte
{
EFFECT_HSV_AH "\x00\xff\xff\xff\xff\xff" " RAGNAROEK"
};
uint8_t demoNumber = 0; // Nummer der aktuellen Laufschrift
uint8_t lfdNumb = 0; // Nummer der aktuellen Spalte in der Schrift
const uint8_t maxText0Number = 32; // ACHTUNG HIER SELBST ERMITTELN!
const uint8_t maxText1Number = 32;
void setup()
{
FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds[0], leds.Size());
//FastLED.setCorrection(true);
FastLED.setBrightness(10);
FastLED.clear(true);
FastLED.show();
}
void loop()
{
static byte lastDemoNumber = 255;
if (lastDemoNumber != demoNumber)
{
switch (demoNumber)
{
case 0: // erste Auswahl
ScrollingMsg.SetFont(FontStormning7x9Data);
ScrollingMsg.Init(&leds, leds.Width(), ScrollingMsg.FontHeight() + 1, 0, 0);
ScrollingMsg.SetTextColrOptions(COLR_RGB | COLR_SINGLE, 0xff, 0x00, 0xff);
break;
case 1: // Zweite Auswahl
ScrollingMsg.SetFont(FontOdinson8x9Data);
ScrollingMsg.Init(&leds, leds.Width(), ScrollingMsg.FontHeight() + 1, 0, 0);
ScrollingMsg.SetTextColrOptions(COLR_RGB | COLR_SINGLE, 0xff, 0x00, 0xff);
break;
}
lastDemoNumber = demoNumber;
}
switch (demoNumber) // Ich schalte je nach Auswahl in einen Zweig
{
case 0: // erste Auswahl
if (ScrollingMsg.UpdateText() == -1) // So übernommen aus dem Original
{
ScrollingMsg.SetText((unsigned char *)TxtDemo, sizeof(TxtDemo) - 1);
}
else
{
FastLED.show();
lfdNumb++; // Nach der Anzeige Hochzählen
if (lfdNumb > maxText0Nummer) // Wenn text durch ist
{
lfdNumb = 0; // Zähler zurücksetzen
demoNumber = 1; // nächsten text anzeigen
}
}
break;
case 1: // Zweite Auswahl
if (ScrollingMsg.UpdateText() == -1) // Hier wie in 1.er Auswahl!
{
ScrollingMsg.SetText((unsigned char *)TxtDemo, sizeof(TxtDemo) - 1);
}
else
{
FastLED.show();
lfdNumb++; // Nach der Anzeige Hochzählen
if (lfdNumb > maxText0Nummer) // Wenn text durch ist
{
lfdNumb = 0; // Zähler zurücksetzen
demoNumber = 0; // ersten text anzeigen
}
}
break;
}
delay(20);
}