Inversement de couleur WS2812B-64

Bonjour tous l monde :slight_smile:
comment puis-je inverser le couleur de texte journal de panneaux matrice led RGB WS2812B-64 8X8

Merci d'avance

en nous donnant beaucoup plus d'informations vous améliorerez vos chances d'avoir une réponse pertinente...

liens vers vos références et materiel utilisé, code avec des balises de code, diagramme du montage, ...

lire les recommandations listées dans "Les bonnes pratiques du Forum Francophone”

Matériel utilisé :

  • Arduino Nano
  • WS2812b-64 Led ( Only ONE Pin 24 bit color)
  • 3 fils pour l'installation (Power + Pin6 data)

Code utilisé :
l'example standard ''matrixtest.ino"

// Adafruit_NeoMatrix example for single NeoPixel Shield.
// Scrolls 'Howdy' across the matrix in a portrait (vertical) orientation.

#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>
#ifndef PSTR
 #define PSTR // Make Arduino Due happy
#endif

#define PIN 6

Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(8, 8, PIN,
  NEO_MATRIX_TOP     + NEO_MATRIX_RIGHT +
  NEO_MATRIX_COLUMNS + NEO_MATRIX_PROGRESSIVE,
  NEO_GRB            + NEO_KHZ800);

const uint16_t colors[] = {
  matrix.Color(0, 255, 0), matrix.Color(0, 255, 0), matrix.Color(0, 255, 0) };

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

int y    = matrix.width();
int pass = 0;

void loop() {
  matrix.fillScreen(1);
  matrix.setCursor(y, 0);
  matrix.print(F("Libre"));
  if(--y < -30) {
    y = matrix.width();
    if(++pass >= 3) pass = 0;
    matrix.setTextColor(colors[pass]);
  }
  matrix.show();
  delay(100);
}

lien ?

Il suffit de changer la couleur passée en argument à matrix.fillScreen() et celle passée en argument à matrix.setTextColor()

2 Likes

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