Einfachen text anzeigen lassen auf 32x8 matrix

Hallo,

leider breche ich mir gerade die Finger - ich möchte einen einfachen Text auf einem 32x8 matrix panel statisch anzeigen lassen.

kann mir da jemand starthilfe geben?

danke schonmal!!

Hier die Komponenten:
Als Basis eine NodeMCU (ESP8266EX)
Als Display 2x diese hier: Longruner WS2812B LED Strip Panel Kit Matrix 8x32 256

Schön wäre ein scrollender Text und am Ende eine statisch sichtbare Telefonnummer.

hier das aktuelle sketch welches als scrolling text funktioniert.

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

#define PIN D4

// The following matrix declaration information is copied from Adafruit's NeoMatrix tiletest example:
//
// MATRIX DECLARATION:
// Parameter 1 = width of EACH NEOPIXEL MATRIX (not total display)
// Parameter 2 = height of each matrix
// Parameter 3 = number of matrices arranged horizontally
// Parameter 4 = number of matrices arranged vertically
// Parameter 5 = pin number (most are valid)
// Parameter 6 = matrix layout flags, add together as needed:
//   NEO_MATRIX_TOP, NEO_MATRIX_BOTTOM, NEO_MATRIX_LEFT, NEO_MATRIX_RIGHT:
//     Position of the FIRST LED in the FIRST MATRIX; pick two, e.g.
//     NEO_MATRIX_TOP + NEO_MATRIX_LEFT for the top-left corner.
//   NEO_MATRIX_ROWS, NEO_MATRIX_COLUMNS: LEDs WITHIN EACH MATRIX are
//     arranged in horizontal rows or in vertical columns, respectively;
//     pick one or the other.
//   NEO_MATRIX_PROGRESSIVE, NEO_MATRIX_ZIGZAG: all rows/columns WITHIN
//     EACH MATRIX proceed in the same order, or alternate lines reverse
//     direction; pick one.
//   NEO_TILE_TOP, NEO_TILE_BOTTOM, NEO_TILE_LEFT, NEO_TILE_RIGHT:
//     Position of the FIRST MATRIX (tile) in the OVERALL DISPLAY; pick
//     two, e.g. NEO_TILE_TOP + NEO_TILE_LEFT for the top-left corner.
//   NEO_TILE_ROWS, NEO_TILE_COLUMNS: the matrices in the OVERALL DISPLAY
//     are arranged in horizontal rows or in vertical columns, respectively;
//     pick one or the other.
//   NEO_TILE_PROGRESSIVE, NEO_TILE_ZIGZAG: the ROWS/COLUMS OF MATRICES
//     (tiles) in the OVERALL DISPLAY proceed in the same order for every
//     line, or alternate lines reverse direction; pick one.  When using
//     zig-zag order, the orientation of the matrices in alternate rows
//     will be rotated 180 degrees (this is normal -- simplifies wiring).
//   See example below for these values in action.
// Parameter 7 = pixel type flags, add together as needed:
//   NEO_RGB     Pixels are wired for RGB bitstream (v1 pixels)
//   NEO_GRB     Pixels are wired for GRB bitstream (v2 pixels)
//   NEO_KHZ400  400 KHz bitstream (e.g. FLORA v1 pixels)
//   NEO_KHZ800  800 KHz bitstream (e.g. High Density LED strip)

// Example with three 10x8 matrices (created using NeoPixel flex strip --
// these grids are not a ready-made product).  In this application we'di
// like to arrange the three matrices side-by-side in a wide display.
// The first matrix (tile) will be at the left, and the first pixel within
// that matrix is at the top left.  The matrices use zig-zag line ordering.
// There's only one row here, so it doesn't matter if we declare it in row
// or column order.  The matrices use 800 KHz (v2) pixels that expect GRB
// color data.

Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(32, 8, 2, 1, PIN,
                            NEO_TILE_BOTTOM   + NEO_TILE_RIGHT   + NEO_MATRIX_ROWS   + NEO_TILE_ZIGZAG +
                            NEO_MATRIX_BOTTOM + NEO_MATRIX_RIGHT + NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG,
                            NEO_GRB + NEO_KHZ800);

// Edit this
// The important stuff, your message and colors

#define arr_len( x )  ( sizeof( x ) / sizeof( *x ) )

char* Text[]= {"TEXT A","TEXT B","Telefonnummer A";
const uint16_t colors[] = {
  matrix.Color(255, 0, 255), matrix.Color(100, 255, 0), matrix.Color(255, 255, 0),matrix.Color(0, 0, 255), matrix.Color(255, 0, 255), matrix.Color(0, 255, 255), matrix.Color(255, 255, 255)};
int brightness = 80;
// End Edit

int numMode = arr_len(Text)-1;
int numColor = arr_len(colors)-1;
int pixelPerChar = 4;
int maxDisplacement;
int mode = 0;

void setup() { 
  matrix.begin();
  matrix.setTextWrap(false);
  matrix.setBrightness(brightness);
  matrix.setTextColor(colors[0]);
}

int y = matrix.height();
int x = matrix.width();
int pass = 0;
int line_pass = 0;

void loop() {
    
  // if mode greater than numMode reset
  if (mode > numMode) { mode = 0; }
  
  matrix.fillScreen(0);
  matrix.setCursor(x, 0);
  scroll(Text[mode],40);
}

// this does the magic of scrolling
void scroll(char* message,int delays) {
  maxDisplacement = strlen(message) * pixelPerChar + matrix.width();
  if(++line_pass > matrix.width()) line_pass = 0;
  matrix.print(String(message));
  if(--x < -maxDisplacement) {
    x = matrix.width();
    if(++pass >= numColor) { pass = 0;  };
    matrix.setTextColor(colors[pass]);
    mode++;
  }
  matrix.show();
  delay(delays);
}

Hallo Luelle,

herzlich willkommen im Arduino-Forum,

Du hast jetzt auf deutsch im englischen Forum gepostet.
Es gibt ein deutsches Unterforum.

Deine bisherigen Angaben

Text auf einem 32x8 matrix-panel statisch anzeigen lassen

sind recht knapp. Es gibt nicht nur einen einzigen Typ 32x8 Matrix.
Es gibt mehrere verschiedene Ansteuerchips für so eine Anzeige und die Möglichkeit so etwas selbst zu bauen. Da benötigt man jeweils unterschiedliche Ansteuersignale.

Damit man dir richtig helfen kann musst du erst einmal mehr Informationen liefern:

  • welcher Microcontroller soll die Matrix ansteuern?
  • welche 32x8-Matrix?

zur Matrix möglichst einen Link zum Datenblatt posten.
Wenn du kein Datenblatt hast wenigstens den Link wo du die Matrix gekauft hast.

Auch hilfreich wäre ein bißchen zu beschreiben wie viel Ahnung du von Programmieren und von Elektronik hast.
vgs

https://create.arduino.cc/projecthub/biharilifehacker/arduino-tutorial-led-matrix-red-32x8-256-led-0f2684

Hängt von deinen Komponenten ab.
Lade deinen Schaltplan hoch, Echtbilder von deinem Aufbau, Links auf die Produkte die du gekauft hast.
Irgendwas muss dir ja vorgeschwebt sein, als du dich für das eine oder andere Display entschieden hast. Also was hast du da genau.

Helfen wobei? Code? Was hast den bisher?

Mit einem ESP8266 und Max7219/7221 Displays habe ich schon erfolgreich

benutzt. Funktioniert aber wahrscheinlich auch mit den meisten anderen Arduinos
und hat einen Haufen andere Funktionen außer "statischen Text anzeigen".

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.