ESP32 + pimoroni 5x5 LED Matrix

Hallo zusammen,

obige Kombination bekomme ich nicht zum laufen. Lt. Hersteller ist der Baustein mit der Bibliothek “#include <Adafruit_IS31FL3731.h>” kompatibel. Nach ein paa Stunden ausprobieren, erhalte ich nun eine rot blinkende LED. Somit scheint schon mal I2C zu funzen.

Adafruit_IS31FL3731 matrix = Adafruit_IS31FL3731(15, 5);

….

void loop {

Befehl: matrix.drawPixel(8, 0, 25);

}

Die oben aufgeführte Definition habe ich probeweise. da ein anderer User damit auch einen ersten Erfolg hatte. Leider hat er nicht weiter gepostet. Habe schon ziemlich viele Seiten besucht, aber keine Klarheit erhalten. Hat hier jemannt vielleicht in Lösung?

Gruß Guido

Im englischen Teil des Forum müssen die Beiträge und Diskussionen in englischer Sprache verfasst werden. Deswegen wurde diese Diskussion in den deutschen Teil des Forums verschoben.

mfg ein Moderator.

Poste bitte einen vollständigen Sketch. Wie das geht , steht hier.

Gruß Tommy

Und ein Link zur verwendeten Matrix sowie zum ESP32 (es gibt nicht nur einen) wären da hilfreich.

Beispiele aus der Bibliothek probiert ?

Sorry, sorry sorry!

Also es ist ein ESP32-S von AZ-Delivery: Link

Die RGB-LED-5x5 Matrix ist von Pimoroni: Link

Einen Code habe “ich” nicht wirklich. Der Code hier ist ein “gefundener” der mir zumindest eine LED zum leuchten brachte.

//
// Bibliotheken
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_IS31FL3731.h>

Adafruit_IS31FL3731 matrix = Adafruit_IS31FL3731(15, 5);


// ##########--- SETUP ---##########
void setup()
{
  //
  Serial.begin(115200);
  if (!matrix.begin(0x74))
  {
    Serial.println("IS31FL3731 nicht gefunden");
    while (1);
  }
}

// ##########--- LOOP ---##########
void loop() 
{
  matrix.drawPixel(8, 0, 25); 
  delay(1000);
  matrix.clear(); // Alle ausschalten
  delay(1000);
}

Ich suche einen Code, der die Matrix überhaupt zum Laufen bringt. Alles was ich bislang im Netz gefunden und ausprobiert habe, war erfolglos. Der Hersteller sagt die Matrix wäre mit der Bibliothek “Adafruit IS31FL3731” kompatibel, aber ich habe bislang nicht die richtigen Parameter gefunden.

Das ist doch schon ein Anfang und weiter geht es mit den Beispielen in der Library. Bzw. einfach mit den funktionierenden Parametern spielen und ändern.

Und beachte, wenn du die Matrix mit 5Volt betreibst, dann birgt es Probleme, die deinen ESP32 über den I2C-Bus zerstören können. Der verträgt auf den Pins keine 5Volt. Da muss ein I2C Levelshifter zwischen.

Danke für den Hinweis, aber die Matrix läuft auch mit 3,3 V.

Ja, ja, ausprobieren …. habe schon etliche Stunden ausprobiert :weary_face:

Dann ließ mal IS31FL3731 16x9 Charlieplexed PWM LED Driver mit diesem Beispiel:

int i = 0;
for (uint8_t x=0; x<16; x++) {
  for (uint8_t y=0; y<9; y++) {
    ledmatrix.drawPixel(x, y, i++);
  }
}

Was siehst Du?

Ich sehe einen “Lichtblick” :grin:

Danke! Ich denke, damit komme icj ein Stück weiter.

Danke für Deine Rückmeldung, bitte berichte von Deinen Fortschritten :wink:

Frohe Ostern :rabbit_face:

Ich bin mit diesem Ansatz nicht weitergekommen, da ich RGB-Dioden habe und nicht die Farbe wechseln kann.

In diesem Forum hat sich aber schon mal jemand an dierser Matrix versucht. Hier der LINK.

Der Kollege “johnwasser” hat Änderungen an der “Adafruit_IS31FL3731.h”-Bibliothek vorgenommen. Ich habe dies nachgemacht, erhalte aber eine Fehlermeldung:

Compilation errpr: ‘Pimoroni_IS31FL3731_5x5RGB’ does noct name a typ

Ich habe die Bibliothek auch installiert. Unter “Sketch -> Bibliothek einbinden” finde ich auch einen >Pimoroni_IS31FL3731< Eintrag … müsste m.E. also installiert sein.

Wo kann ich noch suchen?

Das sieht spannend aus.

Ich denke, um zu verstehen wie das ganze funktionieren soll, ist das Schaltbild ganz wichtig:


Da ist zu erkennen welche LED's an welchem PIN aktiviert wird.

Dann hast du da was falsch gemacht,
und/oder durch deine Änderung nicht die
class Pimoroni_IS31FL3731_5x5RGB definiert.

@johnwasser hat übrigens keine Änderung vorgenommen sondern eine Ergänzung in einer zusätzlichen Datei gemacht. Diese muss in deinem Sketch auch in einer #include Anweisung stehen (anstelle derAdafruit- Bibliothek).

@michael_x

Vielen Dank für Deinen Beitrag. Ja, Du hast recht. Ich habe die Bibliothek nicht geändert, sondern eine Bibliothek runtergeladen und umbenannt.

Hier mein Sketch:

// 5x5 LED Matrix

// Bibliotheken
#include <Wire.h>
#include <Adafruit_GFX.h>
//#include <Adafruit_IS31FL3731.h>
#include <Pimoroni_IS31FL3731_5x5RGB.h>
Pimoroni_IS31FL3731_5x5RGB matrix = Pimoroni_IS31FL3731_5x5RGB();

// ##########--- SETUP ---##########
void setup()
{
  //
  Serial.begin(115200);
  if (!matrix.begin(0x74))
  {
    Serial.println("IS31 nicht gefunden");
    while (1);
  }
  Serial.println("IS31 gefunden!");
}

// ##########--- LOOP ---##########
void loop() 
{
  matrix.clear();
  matrix.drawPixel(1, 1, 128, 128, 128);
  delay(500);
}

Der Fehler kam dadurch, dass ich “#include <Adafruit_GFX.h>” nicht ausgeklammert hatte.

Jetzt findet er eine Reihe von Fehlern ….

c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:10:40: error: 'Pimoroni_IS31FL3731_5x5RGB' has not been declared
   10 |         constexpr std::array< int,25 > Pimoroni_IS31FL3731_5x5RGB::redlookup;
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:10:40: error: uninitialized 'const redlookup' [-fpermissive]
In file included from C:/Users/User/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2511/xtensa-esp-elf/include/c++/14.2.0/functional:65,
                 from C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.7\cores\esp32/HardwareSerial.h:49,
                 from C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.3.7\cores\esp32/Arduino.h:202,
                 from c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:1:
C:/Users/User/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2511/xtensa-esp-elf/include/c++/14.2.0/array:100:12: note: 'const struct std::array<int, 25>' has no user-provided default constructor
  100 |     struct array
      |            ^~~~~
C:/Users/User/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2511/xtensa-esp-elf/include/c++/14.2.0/array:115:55: note: and the implicitly-defined constructor does not initialize 'int std::array<int, 25>::_M_elems [25]'
  115 |       typename __array_traits<_Tp, _Nm>::_Type        _M_elems;
      |                                                       ^~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:11:40: error: 'Pimoroni_IS31FL3731_5x5RGB' has not been declared
   11 |         constexpr std::array< int,25 > Pimoroni_IS31FL3731_5x5RGB::greenlookup;
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:11:40: error: uninitialized 'const greenlookup' [-fpermissive]
C:/Users/User/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2511/xtensa-esp-elf/include/c++/14.2.0/array:100:12: note: 'const struct std::array<int, 25>' has no user-provided default constructor
  100 |     struct array
      |            ^~~~~
C:/Users/User/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2511/xtensa-esp-elf/include/c++/14.2.0/array:115:55: note: and the implicitly-defined constructor does not initialize 'int std::array<int, 25>::_M_elems [25]'
  115 |       typename __array_traits<_Tp, _Nm>::_Type        _M_elems;
      |                                                       ^~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:12:40: error: 'Pimoroni_IS31FL3731_5x5RGB' has not been declared
   12 |         constexpr std::array< int,25 > Pimoroni_IS31FL3731_5x5RGB::bluelookup;
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:12:40: error: uninitialized 'const bluelookup' [-fpermissive]
C:/Users/User/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2511/xtensa-esp-elf/include/c++/14.2.0/array:100:12: note: 'const struct std::array<int, 25>' has no user-provided default constructor
  100 |     struct array
      |            ^~~~~
C:/Users/User/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2511/xtensa-esp-elf/include/c++/14.2.0/array:115:55: note: and the implicitly-defined constructor does not initialize 'int std::array<int, 25>::_M_elems [25]'
  115 |       typename __array_traits<_Tp, _Nm>::_Type        _M_elems;
      |                                                       ^~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:38:1: error: 'Pimoroni_IS31FL3731_5x5RGB' does not name a type
   38 | Pimoroni_IS31FL3731_5x5RGB::Pimoroni_IS31FL3731_5x5RGB(void) : Adafruit_IS31FL3731() {
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:49:6: error: 'Pimoroni_IS31FL3731_5x5RGB' has not been declared
   49 | bool Pimoroni_IS31FL3731_5x5RGB::begin(uint8_t addr) {
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp: In function 'bool begin(uint8_t)':
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:53:3: error: '_i2caddr' was not declared in this scope; did you mean '_ip_addr'?
   53 |   _i2caddr = addr;
      |   ^~~~~~~~
      |   _ip_addr
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:54:3: error: '_frame' was not declared in this scope
   54 |   _frame = 0;
      |   ^~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:63:3: error: 'writeRegister8' was not declared in this scope
   63 |   writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_SHUTDOWN, 0x00);
      |   ^~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:73:3: error: 'displayFrame' was not declared in this scope
   73 |   displayFrame(_frame);
      |   ^~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:76:3: error: 'clear' was not declared in this scope
   76 |   clear(); // set each led to 0 PWM
      |   ^~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:103:3: error: 'audioSync' was not declared in this scope
  103 |   audioSync(false);
      |   ^~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp: At global scope:
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:115:8: error: no declaration matches 'bool Adafruit_IS31FL3731::begin(uint8_t)'
  115 |   bool Adafruit_IS31FL3731::begin(uint8_t addr) {
      |        ^~~~~~~~~~~~~~~~~~~
In file included from c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:4:
c:\Users\User\Documents\Arduino\libraries\Adafruit_IS31FL3731_Library/Adafruit_IS31FL3731.h:35:8: note: candidate is: 'bool Adafruit_IS31FL3731::begin(uint8_t, TwoWire*)'
   35 |   bool begin(uint8_t addr = ISSI_ADDR_DEFAULT, TwoWire *theWire = &Wire);
      |        ^~~~~
c:\Users\User\Documents\Arduino\libraries\Adafruit_IS31FL3731_Library/Adafruit_IS31FL3731.h:32:7: note: 'class Adafruit_IS31FL3731' defined here
   32 | class Adafruit_IS31FL3731 : public Adafruit_GFX {
      |       ^~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp: In member function 'void Adafruit_IS31FL3731::clear()':
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:164:28: error: '_i2caddr' was not declared in this scope; did you mean '_ip_addr'?
  164 |     Wire.beginTransmission(_i2caddr);
      |                            ^~~~~~~~
      |                            _ip_addr
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp: At global scope:
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:174:6: error: no declaration matches 'void Adafruit_IS31FL3731::setBlink(bool)'
  174 | void Adafruit_IS31FL3731::setBlink(bool blinkon) {
      |      ^~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:174:6: note: no functions named 'void Adafruit_IS31FL3731::setBlink(bool)'
c:\Users\User\Documents\Arduino\libraries\Adafruit_IS31FL3731_Library/Adafruit_IS31FL3731.h:32:7: note: 'class Adafruit_IS31FL3731' defined here
   32 | class Adafruit_IS31FL3731 : public Adafruit_GFX {
      |       ^~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:203:6: error: 'Pimoroni_IS31FL3731_5x5RGB' has not been declared
  203 | void Pimoroni_IS31FL3731_5x5RGB::drawPixel(int16_t x, int16_t y, uint8_t red,uint8_t green, uint8_t blue) {
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp: In function 'void drawPixel(int16_t, int16_t, uint8_t, uint8_t, uint8_t)':
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:235:26: error: '_frame' was not declared in this scope
  235 |   setLEDPWM(lednum, red, _frame);
      |                          ^~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:235:3: error: 'setLEDPWM' was not declared in this scope
  235 |   setLEDPWM(lednum, red, _frame);
      |   ^~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp: At global scope:
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:351:6: error: no declaration matches 'void Adafruit_IS31FL3731::selectBank(uint8_t)'
  351 | void Adafruit_IS31FL3731::selectBank(uint8_t bank) {
      |      ^~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Adafruit_IS31FL3731_Library/Adafruit_IS31FL3731.h:45:8: note: candidate is: 'bool Adafruit_IS31FL3731::selectBank(uint8_t)'
   45 |   bool selectBank(uint8_t bank);
      |        ^~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Adafruit_IS31FL3731_Library/Adafruit_IS31FL3731.h:32:7: note: 'class Adafruit_IS31FL3731' defined here
   32 | class Adafruit_IS31FL3731 : public Adafruit_GFX {
      |       ^~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:380:6: error: no declaration matches 'void Adafruit_IS31FL3731::writeRegister8(uint8_t, uint8_t, uint8_t)'
  380 | void Adafruit_IS31FL3731::writeRegister8(uint8_t bank, uint8_t reg, uint8_t data) {
      |      ^~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Adafruit_IS31FL3731_Library/Adafruit_IS31FL3731.h:46:8: note: candidate is: 'bool Adafruit_IS31FL3731::writeRegister8(uint8_t, uint8_t, uint8_t)'
   46 |   bool writeRegister8(uint8_t bank, uint8_t reg, uint8_t data);
      |        ^~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Adafruit_IS31FL3731_Library/Adafruit_IS31FL3731.h:32:7: note: 'class Adafruit_IS31FL3731' defined here
   32 | class Adafruit_IS31FL3731 : public Adafruit_GFX {
      |       ^~~~~~~~~~~~~~~~~~~
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp: In member function 'uint8_t Adafruit_IS31FL3731::readRegister8(uint8_t, uint8_t)':
c:\Users\User\Documents\Arduino\libraries\Pimoroni_IS31FL3731\Pimoroni_IS31FL3731_5x5RGB.cpp:405:25: error: '_i2caddr' was not declared in this scope; did you mean '_ip_addr'?
  405 |  Wire.beginTransmission(_i2caddr);
      |                         ^~~~~~~~
      |                         _ip_addr
exit status 1

Compilation error: exit status 1

….. wer Lust hat, kann ja zu den Fehlern (oder auch einem Fehler) seinen Hinweis abgeben. Danke!

Testprogramm
// 5x5 LED Matrix

// Bibliotheken
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_IS31FL3731.h>
Adafruit_IS31FL3731_5x5RGB matrix = Adafruit_IS31FL3731_5x5RGB();

// ##########--- SETUP ---##########
void setup()
{
  //
  Serial.begin(115200);
  if (!matrix.begin(0x74))
  {
    Serial.println("IS31 nicht gefunden");
    while (1);
  }
  Serial.println("IS31 gefunden!");
}

// ##########--- LOOP ---##########
void loop() 
{
  matrix.clear();
  matrix.drawPixel(1, 1, 128);
  delay(500);
}
Adafruit_IS31FL3731.h
#ifndef _ADAFRUIT_IS31FL3731_H_
#define _ADAFRUIT_IS31FL3731_H_

#include <Adafruit_GFX.h>
#include <Adafruit_I2CDevice.h>
#include <Arduino.h>

#define ISSI_ADDR_DEFAULT 0x74

#define ISSI_REG_CONFIG 0x00
#define ISSI_REG_CONFIG_PICTUREMODE 0x00
#define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08
#define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18

#define ISSI_CONF_PICTUREMODE 0x00
#define ISSI_CONF_AUTOFRAMEMODE 0x04
#define ISSI_CONF_AUDIOMODE 0x08

#define ISSI_REG_PICTUREFRAME 0x01

#define ISSI_REG_SHUTDOWN 0x0A
#define ISSI_REG_AUDIOSYNC 0x06

#define ISSI_COMMANDREGISTER 0xFD
#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine'

/**************************************************************************/
/*!
    @brief Constructor for generic IS31FL3731 breakout version
*/
/**************************************************************************/
class Adafruit_IS31FL3731 : public Adafruit_GFX {
public:
  Adafruit_IS31FL3731(uint8_t x = 16, uint8_t y = 9);
  bool begin(uint8_t addr = ISSI_ADDR_DEFAULT, TwoWire *theWire = &Wire);
  void drawPixel(int16_t x, int16_t y, uint16_t color);
  void clear(void);

  void setLEDPWM(uint8_t lednum, uint8_t pwm, uint8_t bank = 0);
  void audioSync(bool sync);
  void setFrame(uint8_t b);
  void displayFrame(uint8_t frame);

protected:
  bool selectBank(uint8_t bank);
  bool writeRegister8(uint8_t bank, uint8_t reg, uint8_t data);
  uint8_t readRegister8(uint8_t bank, uint8_t reg);
  uint8_t _frame; ///< The frame (of 8) we are currently addressing

private:
  Adafruit_I2CDevice *_i2c_dev = NULL;
};

/**************************************************************************/
/*!
    @brief Constructor for FeatherWing IS31FL3731 version
*/
/**************************************************************************/
class Adafruit_IS31FL3731_Wing : public Adafruit_IS31FL3731 {
public:
  Adafruit_IS31FL3731_Wing(void);
  void drawPixel(int16_t x, int16_t y, uint16_t color);
};

/**************************************************************************/
/*!
    @brief Constructor for 5x5RGB version
*/
/**************************************************************************/
class Adafruit_IS31FL3731_5x5RGB : public Adafruit_IS31FL3731 {
public:
  Adafruit_IS31FL3731_5x5RGB(void);
  void drawPixel(int16_t x, int16_t y, uint16_t color);
};

#endif
Adafruit_IS31FL3731.cpp
#include <Adafruit_IS31FL3731.h>

#ifndef _swap_int16_t
#define _swap_int16_t(a, b)                                                    \
  {                                                                            \
    int16_t t = a;                                                             \
    a = b;                                                                     \
    b = t;                                                                     \
  }
#endif

/**************************************************************************/
/*!
    @brief Constructor for breakout version
    @param width Desired width of led display
    @param height Desired height of led display
*/
/**************************************************************************/

Adafruit_IS31FL3731::Adafruit_IS31FL3731(uint8_t width, uint8_t height)
    : Adafruit_GFX(width, height) {}

/**************************************************************************/
/*!
    @brief Constructor for FeatherWing version (15x7 LEDs)
*/
/**************************************************************************/
Adafruit_IS31FL3731_Wing::Adafruit_IS31FL3731_Wing(void)
    : Adafruit_IS31FL3731(15, 7) {}

/**************************************************************************/
/*!
    @brief Constructor for 5x5RGB version (5x5 LEDs)
*/
/**************************************************************************/
Adafruit_IS31FL3731_5x5RGB::Adafruit_IS31FL3731_5x5RGB(void)
    : Adafruit_IS31FL3731(15, 5) {}


/**************************************************************************/
/*!
    @brief Initialize hardware and clear display
    @param addr The I2C address we expect to find the chip at
    @param theWire The TwoWire I2C bus device to use, defaults to &Wire
    @returns True on success, false if chip isnt found
*/
/**************************************************************************/
bool Adafruit_IS31FL3731::begin(uint8_t addr, TwoWire *theWire) {
  if (_i2c_dev) {
    delete _i2c_dev;
  }
  _i2c_dev = new Adafruit_I2CDevice(addr, theWire);

  if (!_i2c_dev->begin()) {
    return false;
  }

  _i2c_dev->setSpeed(400000);
  _frame = 0;

  // shutdown
  writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_SHUTDOWN, 0x00);

  delay(10);

  // out of shutdown
  writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_SHUTDOWN, 0x01);

  // picture mode
  writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_CONFIG,
                 ISSI_REG_CONFIG_PICTUREMODE);

  displayFrame(_frame);

  // all LEDs on & 0 PWM
  clear(); // set each led to 0 PWM

  for (uint8_t f = 0; f < 8; f++) {
    for (uint8_t i = 0; i <= 0x11; i++)
      writeRegister8(f, i, 0xff); // each 8 LEDs on
  }

  audioSync(false);

  return true;
}

/**************************************************************************/
/*!
    @brief Sets all LEDs on & 0 PWM for current frame.
*/
/**************************************************************************/
void Adafruit_IS31FL3731::clear(void) {
  selectBank(_frame);
  uint8_t erasebuf[25];

  memset(erasebuf, 0, 25);

  for (uint8_t i = 0; i < 6; i++) {
    erasebuf[0] = 0x24 + i * 24;
    _i2c_dev->write(erasebuf, 25);
  }
}

/**************************************************************************/
/*!
    @brief Low level accesssor - sets a 8-bit PWM pixel value to a bank location
    does not handle rotation, x/y or any rearrangements!
    @param lednum The offset into the bank that corresponds to the LED
    @param bank The bank/frame we will set the data in
    @param pwm brightnes, from 0 (off) to 255 (max on)
*/
/**************************************************************************/
void Adafruit_IS31FL3731::setLEDPWM(uint8_t lednum, uint8_t pwm, uint8_t bank) {
  if (lednum >= 144)
    return;
  writeRegister8(bank, 0x24 + lednum, pwm);
}

/**************************************************************************/
/*!
    @brief Adafruit GFX low level accesssor - sets a 8-bit PWM pixel value
    handles rotation and pixel arrangement, unlike setLEDPWM
    @param x The x position, starting with 0 for left-most side
    @param y The y position, starting with 0 for top-most side
    @param color Despite being a 16-bit value, takes 0 (off) to 255 (max on)
*/
/**************************************************************************/
void Adafruit_IS31FL3731_Wing::drawPixel(int16_t x, int16_t y, uint16_t color) {
  // check rotation, move pixel around if necessary
  switch (getRotation()) {
  case 1:
    _swap_int16_t(x, y);
    x = 15 - x - 1;
    break;
  case 2:
    x = 15 - x - 1;
    y = 7 - y - 1;
    break;
  case 3:
    _swap_int16_t(x, y);
    y = 9 - y - 1;
    break;
  }

  // charlie wing is smaller:
  if ((x < 0) || (x >= 16) || (y < 0) || (y >= 7))
    return;

  if (x > 7) {
    x = 15 - x;
    y += 8;
  } else {
    y = 7 - y;
  }

  _swap_int16_t(x, y);

  if (color > 255)
    color = 255; // PWM 8bit max

  setLEDPWM(x + y * 16, color, _frame);
  return;
}

/**************************************************************************/
/*!
    @brief Adafruit GFX low level accesssor - sets a 8-bit PWM pixel value
    handles rotation and pixel arrangement, unlike setLEDPWM
    @param x The x position, starting with 0 for left-most side
    @param y The y position, starting with 0 for top-most side
    @param color Despite being a 16-bit value, takes 0 (off) to 255 (max on)
*/
/**************************************************************************/
void Adafruit_IS31FL3731_5x5RGB::drawPixel(int16_t x, int16_t y, uint16_t color)
{
  // check rotation, move pixel around if necessary
  switch (getRotation())
  {
    case 1:
      _swap_int16_t(x, y);
      x = 15 - x - 1;
      break;
    case 2:
      x = 15 - x - 1;
      y = 7 - y - 1;
      break;
    case 3:
      _swap_int16_t(x, y);
      y = 9 - y - 1;
      break;
  }

  // charlie wing is smaller:
  if ((x < 0) || (x >= 16) || (y < 0) || (y >= 7))
    return;

  if (x > 7)
  {
    x = 15 - x;
    y += 8;
  }
  else
  {
    y = 7 - y;
  }

  _swap_int16_t(x, y);

  if (color > 255)
    color = 255; // PWM 8bit max

  setLEDPWM(x + y * 16, color, _frame);
  return;
}

/**************************************************************************/
/*!
    @brief Adafruit GFX low level accesssor - sets a 8-bit PWM pixel value
    handles rotation and pixel arrangement, unlike setLEDPWM
    @param x The x position, starting with 0 for left-most side
    @param y The y position, starting with 0 for top-most side
    @param color Despite being a 16-bit value, takes 0 (off) to 255 (max on)
*/
/**************************************************************************/
void Adafruit_IS31FL3731::drawPixel(int16_t x, int16_t y, uint16_t color) {
  // check rotation, move pixel around if necessary
  switch (getRotation()) {
  case 1:
    _swap_int16_t(x, y);
    x = 16 - x - 1;
    break;
  case 2:
    x = 16 - x - 1;
    y = 9 - y - 1;
    break;
  case 3:
    _swap_int16_t(x, y);
    y = 9 - y - 1;
    break;
  }

  if ((x < 0) || (x >= 16))
    return;
  if ((y < 0) || (y >= 9))
    return;
  if (color > 255)
    color = 255; // PWM 8bit max

  setLEDPWM(x + y * 16, color, _frame);
  return;
}

/**************************************************************************/
/*!
    @brief Set's this object's frame tracker (does not talk to the chip)
    @param frame Ranges from 0 - 7 for the 8 frames
*/
/**************************************************************************/
void Adafruit_IS31FL3731::setFrame(uint8_t frame) { _frame = frame; }

/**************************************************************************/
/*!
    @brief Have the chip set the display to the contents of a frame
    @param frame Ranges from 0 - 7 for the 8 frames
*/
/**************************************************************************/
void Adafruit_IS31FL3731::displayFrame(uint8_t frame) {
  if (frame > 7)
    frame = 0;
  writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_PICTUREFRAME, frame);
}

/**************************************************************************/
/*!
    @brief Switch to a given bank in the chip memory for future reads
    @param bank The IS31 bank to switch to
    @returns False if I2C command failed to be ack'd
*/
/**************************************************************************/
bool Adafruit_IS31FL3731::selectBank(uint8_t bank) {
  uint8_t cmd[2] = {ISSI_COMMANDREGISTER, bank};
  return _i2c_dev->write(cmd, 2);
}

/**************************************************************************/
/*!
    @brief Enable the audio 'sync' for brightness pulsing (not really tested)
    @param sync True to enable, False to disable
*/
/**************************************************************************/
void Adafruit_IS31FL3731::audioSync(bool sync) {
  if (sync) {
    writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_AUDIOSYNC, 0x1);
  } else {
    writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_AUDIOSYNC, 0x0);
  }
}

/**************************************************************************/
/*!
    @brief Write one byte to a register located in a given bank
    @param bank The IS31 bank to write the register location
    @param reg the offset into the bank to write
    @param data The byte value
    @returns False if I2C command failed to be ack'd
*/
/**************************************************************************/
bool Adafruit_IS31FL3731::writeRegister8(uint8_t bank, uint8_t reg,
                                         uint8_t data) {
  selectBank(bank);

  uint8_t cmd[2] = {reg, data};
  return _i2c_dev->write(cmd, 2);
}

/**************************************************************************/
/*!
    @brief  Read one byte from a register located in a given bank
    @param   bank The IS31 bank to read the register location
    @param   reg the offset into the bank to read
    @return 1 byte value
*/
/**************************************************************************/
uint8_t Adafruit_IS31FL3731::readRegister8(uint8_t bank, uint8_t reg) {
  uint8_t val = 0xFF;

  selectBank(bank);

  _i2c_dev->write_then_read(&reg, 1, &val, 1);

  return val;
}

Der Compiler ist glücklich, die Funktion kann ich mangels Hardware nicht testen.

@agmue

Jepp, der Compiler ist glücklich, aber …..

Ich habe mal rumprobiert:

void loop() 
{
  matrix.clear();
  
  
  matrix.drawPixel(8, 4, 128);     // Pos 2 / 4 / rot
  matrix.drawPixel(8, 2, 64);      // Pos 2 / 2 / rot
  matrix.drawPixel(8, 2, 254);     // Pos 2 / 2 / rot
 
  //matrix.drawPixel(2, 0, 128);   // ---
  //matrix.drawPixel(2, 1, 128);   // ---

  //matrix.drawPixel(2, 2, 128);   // Pos 4 / 3 / blau
  //matrix.drawPixel(2, 2, 64);    // Pos 4 / 3 / blau
  matrix.drawPixel(2, 2, 32);      // Pos 4 / 3 / blau
 
  matrix.drawPixel(2, 3, 128);     // Pos 4 / 4 / blau
  matrix.drawPixel(1, 3, 128);     // Pos 4 / 4 / türkis 
  matrix.drawPixel(2, 4, 128);     // Pos 4 / 5 / blau
  //matrix.drawPixel(4, 1, 128);   // ---
  
  matrix.drawPixel(7, 2, 128);     // Pos 5 / 4 / pink
  matrix.drawPixel(4, 2, 128);     // Pos 5 / 5 / grün
  matrix.drawPixel(6, 2, 128);     // Pos 5 / 5 / grün

  delay(500);
}

… das Ergebnis steht hinter der Zeile im Kommentar.

Abgesehen von der x bzw. y Koordinate, die sich mir noch nicht erschließt , ist die Farbwahl nicht nachvollziehbar. Lt,. definierter “class” (siehe unten) soll der 3te Parameter die Farbe bestimmen. Dies passt hier aber gar nicht.

‘class Adafruit_IS31FL3731_5x5RGB : public Adafruit_IS31FL3731 {
public:
Adafruit_IS31FL3731_5x5RGB(void);
void drawPixel(int16_t x, int16_t y, uint16_t color);
};’

Ich danke Dir für Deine Bemühungen :grinning_face:

Z.B. in diesem Dokument (PDF) auf Seite 6 ist erklärt, wie die Farbwerte beschaffen sein sollten. Es handelt sich um 16 Bit RGB 565, mit jeweils fünf Bit für Rot und Blau sowie sechs Bit für Grün.

0xF800 (63488 dezimal) ist reines Rot, 0x7E0 (2016d) reines Grün und 0x1F (31) reines Blau.
Hier findest Du einen niedlichen Color-Picker.

Das ist hier falsch!

Nachtrag:

Das Problem lässt sich dadurch lösen, indem Du immer nur genau eine Lampe anschaltest (x und y von 0 bis 4, Farbe 0xFFFF) und Dir damit die Zuordnung erschließt.

Das wäre naheliegend, nur finde ich in der Bibliothek Adafruit_IS31FL3731 keine Stelle, wo die Farbe aufgedröselt wird. Siehst Du mehr?

Das sehe ich auch so.

Das IC IS31FL3731 steuert eine Matrix einzelner LEDs an. Der Schaltplan zeigt, daß beispielsweise CA9, CA3 und CA4 in einem RGB-Gehäuse mit Anode an CA1 zusammengefaßt sind. Lt. Datenblatt sind das die PWM-Register A4h, 44h und 54h.

Zieht man den Offset 24h für die PWM-Register ab, erhält man die Werte 80h=128, 20h=32 und 30h=48, die sich auch in einer Python-Tabelle wiederfinden. Könnte also möglicherweise passen.

Die Methode void Adafruit_IS31FL3731_5x5RGB::drawPixel(uint8_t a, uint8_t b, uint8_t c) bezieht sich jetzt nur auf genau diese drei LEDs, deren Helligkeit eingestellt wird. Das Testprogramm macht die einzelnen LEDs nacheinander an, dann alle aus. Idealerweise sollten sich die LEDs innerhalb eines RGB-Gehäuses befinden.

Testprogramm
// 5x5 LED Matrix

// Bibliotheken
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_IS31FL3731.h>
Adafruit_IS31FL3731_5x5RGB matrix = Adafruit_IS31FL3731_5x5RGB();

// ##########--- SETUP ---##########
void setup()
{
  //
  Serial.begin(115200);
  if (!matrix.begin(0x74))
  {
    Serial.println("IS31 nicht gefunden");
    while (1);
  }
  Serial.println("IS31 gefunden!");
}

// ##########--- LOOP ---##########
void loop() 
{
  matrix.clear();
  matrix.drawPixel(255, 0, 0);  // Farbe a
  delay(2000);
  matrix.drawPixel(0, 255, 0);  // Farbe b
  delay(2000);
  matrix.drawPixel(0, 0, 255);  // Farbe c
  delay(2000);
  matrix.drawPixel(0, 0, 0);    // aus
  delay(2000);
}
Adafruit_IS31FL3731.h
#ifndef _ADAFRUIT_IS31FL3731_H_
#define _ADAFRUIT_IS31FL3731_H_

#include <Adafruit_GFX.h>
#include <Adafruit_I2CDevice.h>
#include <Arduino.h>

#define ISSI_ADDR_DEFAULT 0x74

#define ISSI_REG_CONFIG 0x00
#define ISSI_REG_CONFIG_PICTUREMODE 0x00
#define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08
#define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18

#define ISSI_CONF_PICTUREMODE 0x00
#define ISSI_CONF_AUTOFRAMEMODE 0x04
#define ISSI_CONF_AUDIOMODE 0x08

#define ISSI_REG_PICTUREFRAME 0x01

#define ISSI_REG_SHUTDOWN 0x0A
#define ISSI_REG_AUDIOSYNC 0x06

#define ISSI_COMMANDREGISTER 0xFD
#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine'

/**************************************************************************/
/*!
    @brief Constructor for generic IS31FL3731 breakout version
*/
/**************************************************************************/
class Adafruit_IS31FL3731 : public Adafruit_GFX {
public:
  Adafruit_IS31FL3731(uint8_t x = 16, uint8_t y = 9);
  bool begin(uint8_t addr = ISSI_ADDR_DEFAULT, TwoWire *theWire = &Wire);
  void drawPixel(int16_t x, int16_t y, uint16_t color);
  void clear(void);

  void setLEDPWM(uint8_t lednum, uint8_t pwm, uint8_t bank = 0);
  void audioSync(bool sync);
  void setFrame(uint8_t b);
  void displayFrame(uint8_t frame);

protected:
  bool selectBank(uint8_t bank);
  bool writeRegister8(uint8_t bank, uint8_t reg, uint8_t data);
  uint8_t readRegister8(uint8_t bank, uint8_t reg);
  uint8_t _frame; ///< The frame (of 8) we are currently addressing

private:
  Adafruit_I2CDevice *_i2c_dev = NULL;
};

/**************************************************************************/
/*!
    @brief Constructor for FeatherWing IS31FL3731 version
*/
/**************************************************************************/
class Adafruit_IS31FL3731_Wing : public Adafruit_IS31FL3731 {
public:
  Adafruit_IS31FL3731_Wing(void);
  void drawPixel(int16_t x, int16_t y, uint16_t color);
};

/**************************************************************************/
/*!
    @brief Constructor for 5x5RGB version
*/
/**************************************************************************/
class Adafruit_IS31FL3731_5x5RGB : public Adafruit_IS31FL3731 {
public:
  Adafruit_IS31FL3731_5x5RGB(void);
  void drawPixel(uint8_t a, uint8_t b, uint8_t c);
};

#endif
Adafruit_IS31FL3731.cpp
#include <Adafruit_IS31FL3731.h>

#ifndef _swap_int16_t
#define _swap_int16_t(a, b)                                                    \
  {                                                                            \
    int16_t t = a;                                                             \
    a = b;                                                                     \
    b = t;                                                                     \
  }
#endif

/**************************************************************************/
/*!
    @brief Constructor for breakout version
    @param width Desired width of led display
    @param height Desired height of led display
*/
/**************************************************************************/

Adafruit_IS31FL3731::Adafruit_IS31FL3731(uint8_t width, uint8_t height)
    : Adafruit_GFX(width, height) {}

/**************************************************************************/
/*!
    @brief Constructor for FeatherWing version (15x7 LEDs)
*/
/**************************************************************************/
Adafruit_IS31FL3731_Wing::Adafruit_IS31FL3731_Wing(void)
    : Adafruit_IS31FL3731(15, 7) {}

/**************************************************************************/
/*!
    @brief Constructor for 5x5RGB version (5x5 LEDs)
*/
/**************************************************************************/
Adafruit_IS31FL3731_5x5RGB::Adafruit_IS31FL3731_5x5RGB(void)
    : Adafruit_IS31FL3731(5, 5) {}


/**************************************************************************/
/*!
    @brief Initialize hardware and clear display
    @param addr The I2C address we expect to find the chip at
    @param theWire The TwoWire I2C bus device to use, defaults to &Wire
    @returns True on success, false if chip isnt found
*/
/**************************************************************************/
bool Adafruit_IS31FL3731::begin(uint8_t addr, TwoWire *theWire) {
  if (_i2c_dev) {
    delete _i2c_dev;
  }
  _i2c_dev = new Adafruit_I2CDevice(addr, theWire);

  if (!_i2c_dev->begin()) {
    return false;
  }

  _i2c_dev->setSpeed(400000);
  _frame = 0;

  // shutdown
  writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_SHUTDOWN, 0x00);

  delay(10);

  // out of shutdown
  writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_SHUTDOWN, 0x01);

  // picture mode
  writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_CONFIG,
                 ISSI_REG_CONFIG_PICTUREMODE);

  displayFrame(_frame);

  // all LEDs on & 0 PWM
  clear(); // set each led to 0 PWM

  for (uint8_t f = 0; f < 8; f++) {
    for (uint8_t i = 0; i <= 0x11; i++)
      writeRegister8(f, i, 0xff); // each 8 LEDs on
  }

  audioSync(false);

  return true;
}

/**************************************************************************/
/*!
    @brief Sets all LEDs on & 0 PWM for current frame.
*/
/**************************************************************************/
void Adafruit_IS31FL3731::clear(void) {
  selectBank(_frame);
  uint8_t erasebuf[25];

  memset(erasebuf, 0, 25);

  for (uint8_t i = 0; i < 6; i++) {
    erasebuf[0] = 0x24 + i * 24;
    _i2c_dev->write(erasebuf, 25);
  }
}

/**************************************************************************/
/*!
    @brief Low level accesssor - sets a 8-bit PWM pixel value to a bank location
    does not handle rotation, x/y or any rearrangements!
    @param lednum The offset into the bank that corresponds to the LED
    @param bank The bank/frame we will set the data in
    @param pwm brightnes, from 0 (off) to 255 (max on)
*/
/**************************************************************************/
void Adafruit_IS31FL3731::setLEDPWM(uint8_t lednum, uint8_t pwm, uint8_t bank) {
  if (lednum >= 144)
    return;
  writeRegister8(bank, 0x24 + lednum, pwm);
}

/**************************************************************************/
/*!
    @brief Adafruit GFX low level accesssor - sets a 8-bit PWM pixel value
    handles rotation and pixel arrangement, unlike setLEDPWM
    @param x The x position, starting with 0 for left-most side
    @param y The y position, starting with 0 for top-most side
    @param color Despite being a 16-bit value, takes 0 (off) to 255 (max on)
*/
/**************************************************************************/
void Adafruit_IS31FL3731_Wing::drawPixel(int16_t x, int16_t y, uint16_t color) {
  // check rotation, move pixel around if necessary
  switch (getRotation()) {
  case 1:
    _swap_int16_t(x, y);
    x = 15 - x - 1;
    break;
  case 2:
    x = 15 - x - 1;
    y = 7 - y - 1;
    break;
  case 3:
    _swap_int16_t(x, y);
    y = 9 - y - 1;
    break;
  }

  // charlie wing is smaller:
  if ((x < 0) || (x >= 16) || (y < 0) || (y >= 7))
    return;

  if (x > 7) {
    x = 15 - x;
    y += 8;
  } else {
    y = 7 - y;
  }

  _swap_int16_t(x, y);

  if (color > 255)
    color = 255; // PWM 8bit max

  setLEDPWM(x + y * 16, color, _frame);
  return;
}

/**************************************************************************/
/*!
*/
/**************************************************************************/
void Adafruit_IS31FL3731_5x5RGB::drawPixel(uint8_t a, uint8_t b, uint8_t c)
{
  setLEDPWM(0xA4, a, _frame);
  setLEDPWM(0x44, b, _frame);
  setLEDPWM(0x54, c, _frame);
  return;
}

/**************************************************************************/
/*!
    @brief Adafruit GFX low level accesssor - sets a 8-bit PWM pixel value
    handles rotation and pixel arrangement, unlike setLEDPWM
    @param x The x position, starting with 0 for left-most side
    @param y The y position, starting with 0 for top-most side
    @param color Despite being a 16-bit value, takes 0 (off) to 255 (max on)
*/
/**************************************************************************/
void Adafruit_IS31FL3731::drawPixel(int16_t x, int16_t y, uint16_t color) {
  // check rotation, move pixel around if necessary
  switch (getRotation()) {
  case 1:
    _swap_int16_t(x, y);
    x = 16 - x - 1;
    break;
  case 2:
    x = 16 - x - 1;
    y = 9 - y - 1;
    break;
  case 3:
    _swap_int16_t(x, y);
    y = 9 - y - 1;
    break;
  }

  if ((x < 0) || (x >= 16))
    return;
  if ((y < 0) || (y >= 9))
    return;
  if (color > 255)
    color = 255; // PWM 8bit max

  setLEDPWM(x + y * 16, color, _frame);
  return;
}

/**************************************************************************/
/*!
    @brief Set's this object's frame tracker (does not talk to the chip)
    @param frame Ranges from 0 - 7 for the 8 frames
*/
/**************************************************************************/
void Adafruit_IS31FL3731::setFrame(uint8_t frame) { _frame = frame; }

/**************************************************************************/
/*!
    @brief Have the chip set the display to the contents of a frame
    @param frame Ranges from 0 - 7 for the 8 frames
*/
/**************************************************************************/
void Adafruit_IS31FL3731::displayFrame(uint8_t frame) {
  if (frame > 7)
    frame = 0;
  writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_PICTUREFRAME, frame);
}

/**************************************************************************/
/*!
    @brief Switch to a given bank in the chip memory for future reads
    @param bank The IS31 bank to switch to
    @returns False if I2C command failed to be ack'd
*/
/**************************************************************************/
bool Adafruit_IS31FL3731::selectBank(uint8_t bank) {
  uint8_t cmd[2] = {ISSI_COMMANDREGISTER, bank};
  return _i2c_dev->write(cmd, 2);
}

/**************************************************************************/
/*!
    @brief Enable the audio 'sync' for brightness pulsing (not really tested)
    @param sync True to enable, False to disable
*/
/**************************************************************************/
void Adafruit_IS31FL3731::audioSync(bool sync) {
  if (sync) {
    writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_AUDIOSYNC, 0x1);
  } else {
    writeRegister8(ISSI_BANK_FUNCTIONREG, ISSI_REG_AUDIOSYNC, 0x0);
  }
}

/**************************************************************************/
/*!
    @brief Write one byte to a register located in a given bank
    @param bank The IS31 bank to write the register location
    @param reg the offset into the bank to write
    @param data The byte value
    @returns False if I2C command failed to be ack'd
*/
/**************************************************************************/
bool Adafruit_IS31FL3731::writeRegister8(uint8_t bank, uint8_t reg,
                                         uint8_t data) {
  selectBank(bank);

  uint8_t cmd[2] = {reg, data};
  return _i2c_dev->write(cmd, 2);
}

/**************************************************************************/
/*!
    @brief  Read one byte from a register located in a given bank
    @param   bank The IS31 bank to read the register location
    @param   reg the offset into the bank to read
    @return 1 byte value
*/
/**************************************************************************/
uint8_t Adafruit_IS31FL3731::readRegister8(uint8_t bank, uint8_t reg) {
  uint8_t val = 0xFF;

  selectBank(bank);

  _i2c_dev->write_then_read(&reg, 1, &val, 1);

  return val;
}

Was siehst Du?

Nein, da finde ich auch nix. Aber unten drunter liegt ja die Adafruit_GFX - in deren Beschreibung hatte ich das gefunden - und es ist (hier dann offensichtlich) falsch, denn es wird ja immer nur ein uint8_t pwm für eine LED gesetzt.

Darf ich mal fragen, was an diesem Display es denn vor einer Matrix aus RGB-LED wie z.B. WS2812 auszeichnet?