D1 Mini Shield – RGB LED

Last Updated on 15. Oktober 2026 by sfambachLink-Status: OK

7 RGB LEDs im Kreis angeordnet, jede LED kann 24-Bit RGB Farben darstellen und jede LED ist einzeln schaltbar.

Zum D1 mini ESP8266 und ESP 32 gehts hier lang:

Fakten

  • 7 RGB LEDs als Blume angeordnet
  • LED einzeln ansteuerbar
BeschreibungNameD1ESP32C3S2
Signal Pin (vorbelegt)D4GPIO216616

SchaltplanLink-Status: OK

Kompatibilität

D1 TypKompatibelBegründung, wenn nicht
D1 miniJa
D1 mini ProJaNicht getestet
D1 mini LiteJaNicht getestet
D1 32Ja
S2 miniJa
C3JaNicht getestet
Kompatibilität zu den D1 Boards

Anwendungsbereiche

Ansichten

Programmierung

Bibliotheken

Arduino ESP32 Bibliothek V2.0.2

Arduino ESP8266 Bibliothek V3.0.2

Adafruit Neo Pixel V1.10.04

https://github.com/adafruit/Adafruit_NeoPixelLink-Status: OK

D1 Mini Shield – RGB LED – Adafruit NeoPixel Bibliothek installieren

Testprogramm

Quellcode RGBPixelExample.ino (GitHubLink-Status: OK)

/**
   Example for RGB Array
   Show RGB and CMY

   Libs:
   https://github.com/adafruit/Adafruit_NeoPixel

   Written by S. Famach GPL2
   Visit https://www.fambach.net
*/


#define LED_COUNT 7


// output pin +
// pin where the pir is connected
#if defined(ESP8266) // d1 mini
#pragma message("ESP8266 Remove Shield while start!")
#define LED_PIN D4


#elif defined ( ESP32 ) // d1 mini esp32

#if CONFIG_IDF_TARGET_ESP32C3 // c3
#pragma message("ESP32C3")
#define LED_PIN 6

#elif CONFIG_IDF_TARGET_ESP32S2
#pragma message("ESP32S2")
#define LED_PIN 16

#else
#pragma message("ESP32")
#define LED_PIN 16

#endif
#else
#error "Unknown board"
#define LED_PIN -1

#endif


// init adafruits neo pixel
#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel ledController = Adafruit_NeoPixel(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
#define DEF_COLOR 50
static const uint32_t  COLORS[] = { ledController.Color(150, 0, 0), // red
                       ledController.Color(0, DEF_COLOR, 0), // green
                       ledController.Color(0, 0, DEF_COLOR), // blue
                       ledController.Color(DEF_COLOR, DEF_COLOR, 0), // Yellow
                       ledController.Color(0, DEF_COLOR, DEF_COLOR), // Cyan
                       ledController.Color(DEF_COLOR, 0, DEF_COLOR)
                     }; // magenta

uint8_t COLOR_COUNT = 6;

void setup() {
  Serial.begin(115200);
  ledController.begin();
  Serial.println(F("Started"));
}



void loop() {
  ledController.clear(); // Set all pixel colors to 'off'
  delay(500);

  // go over all colors
  for (int j = 0; j < COLOR_COUNT; j++) {
    
    // set all pixels after another
    for (int i = 0; i < LED_COUNT; i++) { // For each pixel...

      // set color of single pixel
      ledController.setPixelColor(i, COLORS[j]);
      ledController.show();   // Send the updated pixel colors to the hardware.

      delay(500); 
    }
  }

}

So siehts aus:

Probleme

—

Fazit

Nette Zusatzplatine, dank der Adafruit Bibliothek leicht anzusteuern, macht Spaß und sorgt bei Anfängern für eine steile Erfolgskurve.

Weitere Beiträge

Andere Shields

Mehr ESPs

Quellen

Quellen zum Shield

HerstellerseiteLink-Status: OK

SchaltplanLink-Status: OK

Arduino BeispieleLink-Status: OK

Quellen zu den Boards

HerstellerseiteLink-Status: OK

SchaltplanLink-Status: OK

CH340 USB TreiberLink-Status: OK

https://arduino-projekte.info/wemos-d1-mini/Link-Status: Unbekannt

https://www.exp-tech.de/plattformen/esp8266/entwicklungsboards/8898/wemos-d1-miniLink-Status: Kaputt

DatumÄnderungAutor
15.10.2026Beispielcode als Code-Block eingefügt (Einbettung über gist-it.appspot.com funktionierte nicht mehr)sfambach
08.10.2026Überschriften-Hierarchie korrigiert (H1→H2, Unterebenen eine Stufe tiefer)sfambach
04.10.2026Rechtschreibung korrigiertsfambach
03.10.2026Log-Liste eingefügtsfambach
16.04.2022Beitrag erstelltsfambach
Logbuch

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert