8×8 RGB Matrix per Twitch- Chat steuern

Elektronics at its best

8×8 RGB Matrix per Twitch- Chat steuern

13. Februar 2020 Allgemein 0

Überall auf Twitch sieht man Dinge die man per Chatbefehl steuern kann, sei es Licht oder Servomotoren.
Da wollte ich nicht hinten dran hängen und habe mich auf die Suche in meiner Bastelkiste gemacht und Sachen gefunden die man dafür Nutzen könnte.

  • 1x Breadboard
  • 1x Wemos D1 Mini
  • 1x 8×8 RGB Matrix
  • 3x Jumper Wires (Male to Female)

Zusammengesteckt war das ganze schnell und nach diesem Plan

Für die 8×8 Matrix habe ich keine separate Stromversorgung genommen da eh nie alle LED´s an sind und auch nicht mit voller Leuchtkraft strahlen.
Worauf aber geachtet werden muss, zumindest bei meiner RGB Matrix: Dout ist das Din. Das habe ich auch nur durch Zufall im Netz gefunden. Als ich die Matrix geliefert bekam und sie mit Din am Pin vom Arduino anschloss dachte ich erst: “Na klasse, haben sie dir kaputten Sch#§§$$% verkauft” bis ich endlich den Hinweis dazu fand und sie richtig anschließen konnte. Da muss man erst einmal drauf kommen.

Um die Bilder auf die Matrix zu bekommen habe ich das Tool vom Youtubekanal TylerTimoJ genommen und zwar die LED Matrix Controll Software 1.1.9 (die findet ihr unter goo.gl/Qr9XfM

Als erstes spielt ihr die “LEDMatrixSerial.ino” auf euren Wemos d1 Mini und passt die Zeile

#define NUM_LEDS 256

an und tauscht die 256 gegen 64 aus. Dann müsst ihr noch den Pin unter

#define DATA_PIN 3

anpassen und D1 auswählen (wenn ihr das so verkabelt habt wie ich).

Jetzt könnt ihr das Programm starten. Schließt das USB- Kabel an und wählt im Programm den entsprechenden COM- Port aus und stellt die Matrixgröße auf 8×8 ein. Ganz oben geht ihr dann auf den Punkt “Select Mode” und wählt “Draw Mode” aus.


Mit den Reglern könnt ihr die helligkeit der entsprechenden Farbe wählen und in der Matrix munter drauf los malen. Nun sollt das gemalte auf der Matrix erscheinen.
Mit dem Button “Export FastLED Code” könnt ihr das Bild als Datei exportieren und nachher in euer Sketch einbinden.

Das ganze sieht dann z.B. so aus:

#include "FastLED.h"

// How many leds in your strip?
#define NUM_LEDS 64

byte pixelType = 0;
char drawIn[4];
char frameIn[768];


// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN.  For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
#define DATA_PIN D1
//#define CLOCK_PIN 13

// Define the array of leds
CRGB leds[NUM_LEDS];

void setup() {
  // Uncomment/edit one of the following lines for your leds arrangement.
  // FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
  FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
  // FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
  // FastLED.addLeds<APA104, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<UCS1903B, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<GW6205, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<GW6205_400, DATA_PIN, RGB>(leds, NUM_LEDS);

  // FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<P9813, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<APA102, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<DOTSTAR, RGB>(leds, NUM_LEDS);

  // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<P9813, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<DOTSTAR, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  Serial.begin(500000);


}

void loop() {
  leds[0] = CRGB(125, 137, 150);
leds[1] = CRGB(0, 0, 0);
leds[2] = CRGB(0, 0, 0);
leds[3] = CRGB(0, 0, 0);
leds[4] = CRGB(0, 0, 0);
leds[5] = CRGB(0, 0, 0);
leds[6] = CRGB(0, 0, 0);
leds[7] = CRGB(0, 0, 0);
leds[8] = CRGB(125, 137, 150);
leds[9] = CRGB(125, 137, 150);
leds[10] = CRGB(125, 137, 150);
leds[11] = CRGB(0, 0, 0);
leds[12] = CRGB(0, 0, 0);
leds[13] = CRGB(0, 0, 0);
leds[14] = CRGB(0, 0, 0);
leds[15] = CRGB(0, 0, 0);
leds[16] = CRGB(0, 0, 0);
leds[17] = CRGB(125, 137, 150);
leds[18] = CRGB(0, 0, 0);
leds[19] = CRGB(0, 0, 0);
leds[20] = CRGB(0, 0, 0);
leds[21] = CRGB(125, 137, 150);
leds[22] = CRGB(125, 137, 150);
leds[23] = CRGB(0, 0, 0);
leds[24] = CRGB(0, 0, 0);
leds[25] = CRGB(0, 0, 0);
leds[26] = CRGB(125, 137, 150);
leds[27] = CRGB(125, 137, 150);
leds[28] = CRGB(0, 0, 0);
leds[29] = CRGB(0, 0, 0);
leds[30] = CRGB(0, 0, 0);
leds[31] = CRGB(0, 0, 0);
leds[32] = CRGB(125, 137, 150);
leds[33] = CRGB(125, 137, 150);
leds[34] = CRGB(0, 0, 0);
leds[35] = CRGB(125, 137, 150);
leds[36] = CRGB(125, 137, 150);
leds[37] = CRGB(0, 0, 0);
leds[38] = CRGB(0, 0, 0);
leds[39] = CRGB(0, 0, 0);
leds[40] = CRGB(0, 0, 0);
leds[41] = CRGB(0, 0, 0);
leds[42] = CRGB(0, 0, 0);
leds[43] = CRGB(0, 0, 0);
leds[44] = CRGB(125, 137, 150);
leds[45] = CRGB(125, 137, 150);
leds[46] = CRGB(0, 0, 0);
leds[47] = CRGB(0, 0, 0);
leds[48] = CRGB(0, 0, 0);
leds[49] = CRGB(0, 0, 0);
leds[50] = CRGB(0, 0, 0);
leds[51] = CRGB(0, 0, 0);
leds[52] = CRGB(0, 0, 0);
leds[53] = CRGB(125, 137, 150);
leds[54] = CRGB(125, 137, 150);
leds[55] = CRGB(125, 137, 150);
leds[56] = CRGB(0, 0, 0);
leds[57] = CRGB(0, 0, 0);
leds[58] = CRGB(0, 0, 0);
leds[59] = CRGB(0, 0, 0);
leds[60] = CRGB(0, 0, 0);
leds[61] = CRGB(0, 0, 0);
leds[62] = CRGB(125, 137, 150);
leds[63] = CRGB(0, 0, 0);
leds[64] = CRGB(0, 0, 0);
leds[65] = CRGB(125, 137, 150);
leds[66] = CRGB(125, 137, 150);
leds[67] = CRGB(0, 0, 0);
leds[68] = CRGB(0, 0, 0);
leds[69] = CRGB(0, 0, 0);
leds[70] = CRGB(0, 0, 0);
leds[71] = CRGB(125, 137, 150);
leds[72] = CRGB(0, 0, 0);
leds[73] = CRGB(0, 0, 0);
leds[74] = CRGB(0, 0, 0);
leds[75] = CRGB(0, 0, 0);
leds[76] = CRGB(0, 0, 0);
leds[77] = CRGB(125, 137, 150);
leds[78] = CRGB(0, 0, 0);
leds[79] = CRGB(0, 0, 0);
leds[80] = CRGB(125, 137, 150);
leds[81] = CRGB(125, 137, 150);
leds[82] = CRGB(0, 0, 0);
leds[83] = CRGB(0, 0, 0);
leds[84] = CRGB(0, 0, 0);
leds[85] = CRGB(0, 0, 0);
leds[86] = CRGB(0, 0, 0);
leds[87] = CRGB(0, 0, 0);
leds[88] = CRGB(0, 0, 0);
leds[89] = CRGB(0, 0, 0);
leds[90] = CRGB(125, 137, 150);
leds[91] = CRGB(0, 0, 0);
leds[92] = CRGB(0, 0, 0);
leds[93] = CRGB(0, 0, 0);
leds[94] = CRGB(0, 0, 0);
leds[95] = CRGB(0, 0, 0);
leds[96] = CRGB(0, 0, 0);
leds[97] = CRGB(0, 0, 0);
leds[98] = CRGB(125, 137, 150);
leds[99] = CRGB(125, 137, 150);
FastLED.show();

  }

Um das ganze zu animieren braucht es noch einen zweiten Frame den ihr mit dem Programm erstellt und dann unter den oberen Code einfügt:

#include "FastLED.h"

// How many leds in your strip?
#define NUM_LEDS 64

byte pixelType = 0;
char drawIn[4];
char frameIn[768];


// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN.  For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
#define DATA_PIN D1
//#define CLOCK_PIN 13

// Define the array of leds
CRGB leds[NUM_LEDS];

void setup() {
  // Uncomment/edit one of the following lines for your leds arrangement.
  // FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
  FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
  // FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
  // FastLED.addLeds<APA104, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<UCS1903B, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<GW6205, DATA_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<GW6205_400, DATA_PIN, RGB>(leds, NUM_LEDS);

  // FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<P9813, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<APA102, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<DOTSTAR, RGB>(leds, NUM_LEDS);

  // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<P9813, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<DOTSTAR, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  Serial.begin(500000);


}

void loop() {
  leds[0] = CRGB(125, 137, 150);
leds[1] = CRGB(0, 0, 0);
leds[2] = CRGB(0, 0, 0);
leds[3] = CRGB(0, 0, 0);
leds[4] = CRGB(0, 0, 0);
leds[5] = CRGB(0, 0, 0);
leds[6] = CRGB(0, 0, 0);
leds[7] = CRGB(0, 0, 0);
leds[8] = CRGB(125, 137, 150);
leds[9] = CRGB(125, 137, 150);
leds[10] = CRGB(125, 137, 150);
leds[11] = CRGB(0, 0, 0);
leds[12] = CRGB(0, 0, 0);
leds[13] = CRGB(0, 0, 0);
leds[14] = CRGB(0, 0, 0);
leds[15] = CRGB(0, 0, 0);
leds[16] = CRGB(0, 0, 0);
leds[17] = CRGB(125, 137, 150);
leds[18] = CRGB(0, 0, 0);
leds[19] = CRGB(0, 0, 0);
leds[20] = CRGB(0, 0, 0);
leds[21] = CRGB(125, 137, 150);
leds[22] = CRGB(125, 137, 150);
leds[23] = CRGB(0, 0, 0);
leds[24] = CRGB(0, 0, 0);
leds[25] = CRGB(0, 0, 0);
leds[26] = CRGB(125, 137, 150);
leds[27] = CRGB(125, 137, 150);
leds[28] = CRGB(0, 0, 0);
leds[29] = CRGB(0, 0, 0);
leds[30] = CRGB(0, 0, 0);
leds[31] = CRGB(0, 0, 0);
leds[32] = CRGB(125, 137, 150);
leds[33] = CRGB(125, 137, 150);
leds[34] = CRGB(0, 0, 0);
leds[35] = CRGB(125, 137, 150);
leds[36] = CRGB(125, 137, 150);
leds[37] = CRGB(0, 0, 0);
leds[38] = CRGB(0, 0, 0);
leds[39] = CRGB(0, 0, 0);
leds[40] = CRGB(0, 0, 0);
leds[41] = CRGB(0, 0, 0);
leds[42] = CRGB(0, 0, 0);
leds[43] = CRGB(0, 0, 0);
leds[44] = CRGB(125, 137, 150);
leds[45] = CRGB(125, 137, 150);
leds[46] = CRGB(0, 0, 0);
leds[47] = CRGB(0, 0, 0);
leds[48] = CRGB(0, 0, 0);
leds[49] = CRGB(0, 0, 0);
leds[50] = CRGB(0, 0, 0);
leds[51] = CRGB(0, 0, 0);
leds[52] = CRGB(0, 0, 0);
leds[53] = CRGB(125, 137, 150);
leds[54] = CRGB(125, 137, 150);
leds[55] = CRGB(125, 137, 150);
leds[56] = CRGB(0, 0, 0);
leds[57] = CRGB(0, 0, 0);
leds[58] = CRGB(0, 0, 0);
leds[59] = CRGB(0, 0, 0);
leds[60] = CRGB(0, 0, 0);
leds[61] = CRGB(0, 0, 0);
leds[62] = CRGB(125, 137, 150);
leds[63] = CRGB(0, 0, 0);
leds[64] = CRGB(0, 0, 0);
leds[65] = CRGB(125, 137, 150);
leds[66] = CRGB(125, 137, 150);
leds[67] = CRGB(0, 0, 0);
leds[68] = CRGB(0, 0, 0);
leds[69] = CRGB(0, 0, 0);
leds[70] = CRGB(0, 0, 0);
leds[71] = CRGB(125, 137, 150);
leds[72] = CRGB(0, 0, 0);
leds[73] = CRGB(0, 0, 0);
leds[74] = CRGB(0, 0, 0);
leds[75] = CRGB(0, 0, 0);
leds[76] = CRGB(0, 0, 0);
leds[77] = CRGB(125, 137, 150);
leds[78] = CRGB(0, 0, 0);
leds[79] = CRGB(0, 0, 0);
leds[80] = CRGB(125, 137, 150);
leds[81] = CRGB(125, 137, 150);
leds[82] = CRGB(0, 0, 0);
leds[83] = CRGB(0, 0, 0);
leds[84] = CRGB(0, 0, 0);
leds[85] = CRGB(0, 0, 0);
leds[86] = CRGB(0, 0, 0);
leds[87] = CRGB(0, 0, 0);
leds[88] = CRGB(0, 0, 0);
leds[89] = CRGB(0, 0, 0);
leds[90] = CRGB(125, 137, 150);
leds[91] = CRGB(0, 0, 0);
leds[92] = CRGB(0, 0, 0);
leds[93] = CRGB(0, 0, 0);
leds[94] = CRGB(0, 0, 0);
leds[95] = CRGB(0, 0, 0);
leds[96] = CRGB(0, 0, 0);
leds[97] = CRGB(0, 0, 0);
leds[98] = CRGB(125, 137, 150);
leds[99] = CRGB(125, 137, 150);
FastLED.show();
delay(500);
leds[0] = CRGB(0, 0, 0);
leds[1] = CRGB(0, 0, 0);
leds[2] = CRGB(0, 0, 0);
leds[3] = CRGB(0, 0, 0);
leds[4] = CRGB(125, 137, 150);
leds[5] = CRGB(0, 0, 0);
leds[6] = CRGB(0, 0, 0);
leds[7] = CRGB(0, 0, 0);
leds[8] = CRGB(0, 0, 0);
leds[9] = CRGB(0, 0, 0);
leds[10] = CRGB(0, 0, 0);
leds[11] = CRGB(0, 0, 0);
leds[12] = CRGB(125, 137, 150);
leds[13] = CRGB(0, 0, 0);
leds[14] = CRGB(0, 0, 0);
leds[15] = CRGB(0, 0, 0);
leds[16] = CRGB(0, 0, 0);
leds[17] = CRGB(0, 0, 0);
leds[18] = CRGB(0, 0, 0);
leds[19] = CRGB(0, 0, 0);
leds[20] = CRGB(125, 137, 150);
leds[21] = CRGB(0, 0, 0);
leds[22] = CRGB(0, 0, 0);
leds[23] = CRGB(0, 0, 0);
leds[24] = CRGB(125, 137, 150);
leds[25] = CRGB(125, 137, 150);
leds[26] = CRGB(125, 137, 150);
leds[27] = CRGB(125, 137, 150);
leds[28] = CRGB(125, 137, 150);
leds[29] = CRGB(125, 137, 150);
leds[30] = CRGB(125, 137, 150);
leds[31] = CRGB(125, 137, 150);
leds[32] = CRGB(0, 0, 0);
leds[33] = CRGB(0, 0, 0);
leds[34] = CRGB(0, 0, 0);
leds[35] = CRGB(0, 0, 0);
leds[36] = CRGB(125, 137, 150);
leds[37] = CRGB(0, 0, 0);
leds[38] = CRGB(0, 0, 0);
leds[39] = CRGB(0, 0, 0);
leds[40] = CRGB(0, 0, 0);
leds[41] = CRGB(0, 0, 0);
leds[42] = CRGB(0, 0, 0);
leds[43] = CRGB(0, 0, 0);
leds[44] = CRGB(125, 137, 150);
leds[45] = CRGB(0, 0, 0);
leds[46] = CRGB(0, 0, 0);
leds[47] = CRGB(0, 0, 0);
leds[48] = CRGB(0, 0, 0);
leds[49] = CRGB(0, 0, 0);
leds[50] = CRGB(0, 0, 0);
leds[51] = CRGB(0, 0, 0);
leds[52] = CRGB(125, 137, 150);
leds[53] = CRGB(0, 0, 0);
leds[54] = CRGB(0, 0, 0);
leds[55] = CRGB(0, 0, 0);
leds[56] = CRGB(0, 0, 0);
leds[57] = CRGB(0, 0, 0);
leds[58] = CRGB(0, 0, 0);
leds[59] = CRGB(0, 0, 0);
leds[60] = CRGB(125, 137, 150);
leds[61] = CRGB(0, 0, 0);
leds[62] = CRGB(0, 0, 0);
leds[63] = CRGB(0, 0, 0);
FastLED.show();
delay(500);

  }

Setzt ein <delay> dazwischen damit das ganze nicht nur wild rumflackert und ihr die einzelnen Frames auch deutlich sehen könnt.

So kann es dann aussehen.

Jetzt wollen wir das ganze mit Twitch steuern, aber wie?
Es gibt ein Sketch von noycebru der unter https://github.com/noycebru/bubble-machine/blob/master/arduino%20code zu finden ist, allerdings funktionierte er bei mir nicht wirklich. Aber dank der Hilfe von Mr. Bob aus dem “Ach Nina” Discord konnte er ans laufen gebracht werden und sah dann wie folgt aus:

/*******************************************************************
    Connect to Twtich Chat with a Bot
   Created with code from TheOtherLoneStar (https://www.twitch.tv/theotherlonestar)
   Hackaday IO: https://hackaday.io/otherlonestar
   By Brian Lough (https://www.twitch.tv/brianlough)
   YouTube: https://www.youtube.com/channel/UCezJOfu7OtqGzd5xrP3q6WA
Created with code from noycebru www.twitch.tv/noycebru
 *******************************************************************/
 
#include <ESP8266WiFi.h>          //https://github.com/esp8266/Arduino
#include <IRCClient.h>
 
//define your default values here, if there are different values in config.json, they are overwritten.
 
#define IRC_SERVER   "irc.chat.twitch.tv"
#define IRC_PORT     6667
 
//------- Replace the following! ------
char ssid[] = "xxx";       // your network SSID (name)
char password[] = "xxx";  // your network key
 
//The name of the channel that you want the bot to join
const String twitchChannelName = "xxx";
 
//The name that you want the bot to have
#define TWITCH_BOT_NAME "xxx"
 
//OAuth Key for your twitch bot
// https://twitchapps.com/tmi/
#define TWITCH_OAUTH_TOKEN "oauth:xxx"
 
 
//------------------------------
 
 
int led = D2;
String ircChannel = "";
 
WiFiClient wiFiClient;
IRCClient client(IRC_SERVER, IRC_PORT, wiFiClient);
 
// put your setup code here, to run once:
void setup() {
 
  pinMode(led, OUTPUT);
 
  Serial.begin(115200);
  Serial.println();
 
  // Set WiFi to station mode and disconnect from an AP if it was Previously
  // connected
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);
 
  // Attempt to connect to Wifi network:
  Serial.print("Connecting Wifi: ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    delay(500);
  }
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  IPAddress ip = WiFi.localIP();
  Serial.println(ip);
 
  ircChannel = "#" + twitchChannelName;
 
  client.setCallback(callback);
}
 
void loop() {
 
  // Try to connect to chat. If it loses connection try again
  if (!client.connected()) {
    Serial.println("Attempting to connect to " + ircChannel );
    // Attempt to connect
    // Second param is not needed by Twtich
    if (client.connect(TWITCH_BOT_NAME, "", TWITCH_OAUTH_TOKEN)) {
      client.sendRaw("JOIN " + ircChannel);
      Serial.println("connected and ready to rock");
      sendTwitchMessage("Ready to go Boss!");
    } else {
      Serial.println("failed... try again in 5 seconds");
      // Wait 5 seconds before retrying
      delay(5000);
    }
    return;
  }
  client.loop();
}
 
void sendTwitchMessage(String message) {
  client.sendMessage(ircChannel, message);
}
 
 
void callback(IRCMessage ircMessage) {
  //Serial.println("In CallBack");
 
  if (ircMessage.command == "PRIVMSG" && ircMessage.text[0] != '\001') {
    //Serial.println("Passed private message.");
   
    ircMessage.nick.toUpperCase();
 
    String message("<" + ircMessage.nick + "> " + ircMessage.text);
 
    //prints chat to serial
    Serial.println(message);
   
if (ircMessage.text == "!LED_AN")
      {
       
      sendTwitchMessage("LED AN");  
      Serial.println("LED ON");
      digitalWrite(led, 1);   
    }

if (ircMessage.text == "!LED_AUS")
      {
      sendTwitchMessage("LED AUS");  
      Serial.println("LED OFF");
      digitalWrite(led, 0);   
    }
 
    return;
  }
}

Die Parts die mit “xxx” gekennzeichnet sind müssen mit euren Daten gefüllt werden.
Mit diesem Code kann man die interne LED per Befehl <!LED_AN> im Twitch Chat zum leuchten bringen. Aber wir wollen mehr 😉
Dafür könnt ihr den Code wie folgt anpassen:

/*******************************************************************
    Connect to Twtich Chat with a Bot
   Created with code from TheOtherLoneStar (https://www.twitch.tv/theotherlonestar)
   Hackaday IO: https://hackaday.io/otherlonestar
   By Brian Lough (https://www.twitch.tv/brianlough)
   YouTube: https://www.youtube.com/channel/UCezJOfu7OtqGzd5xrP3q6WA
Created with code from noycebru www.twitch.tv/noycebru
 *******************************************************************/
 
#include <ESP8266WiFi.h>          //https://github.com/esp8266/Arduino
#include <IRCClient.h>
#include "FastLED.h"
 
//define your default values here, if there are different values in config.json, they are overwritten.
 
#define IRC_SERVER   "irc.chat.twitch.tv"
#define IRC_PORT     6667
#define NUM_LEDS 64
#define DATA_PIN D1

byte pixelType = 0;
char drawIn[4];
char frameIn[768];
//------- Replace the following! ------
char ssid[] = "xxx";       // your network SSID (name)
char password[] = "xxx";  // your network key
 
//The name of the channel that you want the bot to join
const String twitchChannelName = "xxx";
 
//The name that you want the bot to have
#define TWITCH_BOT_NAME "xxx"
 
//OAuth Key for your twitch bot
// https://twitchapps.com/tmi/
#define TWITCH_OAUTH_TOKEN "oauth:xxx"
 CRGB leds[NUM_LEDS];
 
//------------------------------
 
 
int led = D2;
String ircChannel = "";
 
WiFiClient wiFiClient;
IRCClient client(IRC_SERVER, IRC_PORT, wiFiClient);
 
// put your setup code here, to run once:
void setup() {
 FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
  pinMode(led, OUTPUT);
 
  Serial.begin(115200);
  Serial.println();
 
  // Set WiFi to station mode and disconnect from an AP if it was Previously
  // connected
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);
 
  // Attempt to connect to Wifi network:
  Serial.print("Connecting Wifi: ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    delay(500);
  }
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  IPAddress ip = WiFi.localIP();
  Serial.println(ip);
 
  ircChannel = "#" + twitchChannelName;
 
  client.setCallback(callback);
}
 
void loop() {
 
  // Try to connect to chat. If it loses connection try again
  if (!client.connected()) {
    Serial.println("Attempting to connect to " + ircChannel );
    // Attempt to connect
    // Second param is not needed by Twtich
    if (client.connect(TWITCH_BOT_NAME, "", TWITCH_OAUTH_TOKEN)) {
      client.sendRaw("JOIN " + ircChannel);
      Serial.println("connected and ready to rock");
      sendTwitchMessage("Ready to go Boss!");
    } else {
      Serial.println("failed... try again in 5 seconds");
      // Wait 5 seconds before retrying
      delay(5000);
    }
    return;
  }
  client.loop();
  
}
 
void sendTwitchMessage(String message) {
  client.sendMessage(ircChannel, message);
}
 
 
void callback(IRCMessage ircMessage) {
  int z;
  //Serial.println("In CallBack");

  if (ircMessage.command == "PRIVMSG" && ircMessage.text[0] != '\001') {
    //Serial.println("Passed private message.");
   
    ircMessage.nick.toUpperCase();
 
    String message("<" + ircMessage.nick + "> " + ircMessage.text);
 
    //prints chat to serial
    Serial.println(message);
   
if (ircMessage.text == "!befehl")
      {
       
      sendTwitchMessage("Hier blinkt es");  
      Serial.println("LEDMatrix an");
      
z = 1;
  do {
      Serial.println(z);
        z++;
leds[0] = CRGB(125, 137, 150);
leds[1] = CRGB(0, 0, 0);
leds[2] = CRGB(0, 0, 0);
leds[3] = CRGB(0, 0, 0);
leds[4] = CRGB(0, 0, 0);
leds[5] = CRGB(0, 0, 0);
leds[6] = CRGB(0, 0, 0);
leds[7] = CRGB(0, 0, 0);
leds[8] = CRGB(125, 137, 150);
leds[9] = CRGB(125, 137, 150);
leds[10] = CRGB(125, 137, 150);
leds[11] = CRGB(0, 0, 0);
leds[12] = CRGB(0, 0, 0);
leds[13] = CRGB(0, 0, 0);
leds[14] = CRGB(0, 0, 0);
leds[15] = CRGB(0, 0, 0);
leds[16] = CRGB(0, 0, 0);
leds[17] = CRGB(125, 137, 150);
leds[18] = CRGB(0, 0, 0);
leds[19] = CRGB(0, 0, 0);
leds[20] = CRGB(0, 0, 0);
leds[21] = CRGB(125, 137, 150);
leds[22] = CRGB(125, 137, 150);
leds[23] = CRGB(0, 0, 0);
leds[24] = CRGB(0, 0, 0);
leds[25] = CRGB(0, 0, 0);
leds[26] = CRGB(125, 137, 150);
leds[27] = CRGB(125, 137, 150);
leds[28] = CRGB(0, 0, 0);
leds[29] = CRGB(0, 0, 0);
leds[30] = CRGB(0, 0, 0);
leds[31] = CRGB(0, 0, 0);
leds[32] = CRGB(125, 137, 150);
leds[33] = CRGB(125, 137, 150);
leds[34] = CRGB(0, 0, 0);
leds[35] = CRGB(125, 137, 150);
leds[36] = CRGB(125, 137, 150);
leds[37] = CRGB(0, 0, 0);
leds[38] = CRGB(0, 0, 0);
leds[39] = CRGB(0, 0, 0);
leds[40] = CRGB(0, 0, 0);
leds[41] = CRGB(0, 0, 0);
leds[42] = CRGB(0, 0, 0);
leds[43] = CRGB(0, 0, 0);
leds[44] = CRGB(125, 137, 150);
leds[45] = CRGB(125, 137, 150);
leds[46] = CRGB(0, 0, 0);
leds[47] = CRGB(0, 0, 0);
leds[48] = CRGB(0, 0, 0);
leds[49] = CRGB(0, 0, 0);
leds[50] = CRGB(0, 0, 0);
leds[51] = CRGB(0, 0, 0);
leds[52] = CRGB(0, 0, 0);
leds[53] = CRGB(125, 137, 150);
leds[54] = CRGB(125, 137, 150);
leds[55] = CRGB(125, 137, 150);
leds[56] = CRGB(0, 0, 0);
leds[57] = CRGB(0, 0, 0);
leds[58] = CRGB(0, 0, 0);
leds[59] = CRGB(0, 0, 0);
leds[60] = CRGB(0, 0, 0);
leds[61] = CRGB(0, 0, 0);
leds[62] = CRGB(125, 137, 150);
leds[63] = CRGB(0, 0, 0);
leds[64] = CRGB(0, 0, 0);
leds[65] = CRGB(125, 137, 150);
leds[66] = CRGB(125, 137, 150);
leds[67] = CRGB(0, 0, 0);
leds[68] = CRGB(0, 0, 0);
leds[69] = CRGB(0, 0, 0);
leds[70] = CRGB(0, 0, 0);
leds[71] = CRGB(125, 137, 150);
leds[72] = CRGB(0, 0, 0);
leds[73] = CRGB(0, 0, 0);
leds[74] = CRGB(0, 0, 0);
leds[75] = CRGB(0, 0, 0);
leds[76] = CRGB(0, 0, 0);
leds[77] = CRGB(125, 137, 150);
leds[78] = CRGB(0, 0, 0);
leds[79] = CRGB(0, 0, 0);
leds[80] = CRGB(125, 137, 150);
leds[81] = CRGB(125, 137, 150);
leds[82] = CRGB(0, 0, 0);
leds[83] = CRGB(0, 0, 0);
leds[84] = CRGB(0, 0, 0);
leds[85] = CRGB(0, 0, 0);
leds[86] = CRGB(0, 0, 0);
leds[87] = CRGB(0, 0, 0);
leds[88] = CRGB(0, 0, 0);
leds[89] = CRGB(0, 0, 0);
leds[90] = CRGB(125, 137, 150);
leds[91] = CRGB(0, 0, 0);
leds[92] = CRGB(0, 0, 0);
leds[93] = CRGB(0, 0, 0);
leds[94] = CRGB(0, 0, 0);
leds[95] = CRGB(0, 0, 0);
leds[96] = CRGB(0, 0, 0);
leds[97] = CRGB(0, 0, 0);
leds[98] = CRGB(125, 137, 150);
leds[99] = CRGB(125, 137, 150);
FastLED.show();
delay(500);
leds[0] = CRGB(0, 0, 0);
leds[1] = CRGB(0, 0, 0);
leds[2] = CRGB(0, 0, 0);
leds[3] = CRGB(0, 0, 0);
leds[4] = CRGB(125, 137, 150);
leds[5] = CRGB(0, 0, 0);
leds[6] = CRGB(0, 0, 0);
leds[7] = CRGB(0, 0, 0);
leds[8] = CRGB(0, 0, 0);
leds[9] = CRGB(0, 0, 0);
leds[10] = CRGB(0, 0, 0);
leds[11] = CRGB(0, 0, 0);
leds[12] = CRGB(125, 137, 150);
leds[13] = CRGB(0, 0, 0);
leds[14] = CRGB(0, 0, 0);
leds[15] = CRGB(0, 0, 0);
leds[16] = CRGB(0, 0, 0);
leds[17] = CRGB(0, 0, 0);
leds[18] = CRGB(0, 0, 0);
leds[19] = CRGB(0, 0, 0);
leds[20] = CRGB(125, 137, 150);
leds[21] = CRGB(0, 0, 0);
leds[22] = CRGB(0, 0, 0);
leds[23] = CRGB(0, 0, 0);
leds[24] = CRGB(125, 137, 150);
leds[25] = CRGB(125, 137, 150);
leds[26] = CRGB(125, 137, 150);
leds[27] = CRGB(125, 137, 150);
leds[28] = CRGB(125, 137, 150);
leds[29] = CRGB(125, 137, 150);
leds[30] = CRGB(125, 137, 150);
leds[31] = CRGB(125, 137, 150);
leds[32] = CRGB(0, 0, 0);
leds[33] = CRGB(0, 0, 0);
leds[34] = CRGB(0, 0, 0);
leds[35] = CRGB(0, 0, 0);
leds[36] = CRGB(125, 137, 150);
leds[37] = CRGB(0, 0, 0);
leds[38] = CRGB(0, 0, 0);
leds[39] = CRGB(0, 0, 0);
leds[40] = CRGB(0, 0, 0);
leds[41] = CRGB(0, 0, 0);
leds[42] = CRGB(0, 0, 0);
leds[43] = CRGB(0, 0, 0);
leds[44] = CRGB(125, 137, 150);
leds[45] = CRGB(0, 0, 0);
leds[46] = CRGB(0, 0, 0);
leds[47] = CRGB(0, 0, 0);
leds[48] = CRGB(0, 0, 0);
leds[49] = CRGB(0, 0, 0);
leds[50] = CRGB(0, 0, 0);
leds[51] = CRGB(0, 0, 0);
leds[52] = CRGB(125, 137, 150);
leds[53] = CRGB(0, 0, 0);
leds[54] = CRGB(0, 0, 0);
leds[55] = CRGB(0, 0, 0);
leds[56] = CRGB(0, 0, 0);
leds[57] = CRGB(0, 0, 0);
leds[58] = CRGB(0, 0, 0);
leds[59] = CRGB(0, 0, 0);
leds[60] = CRGB(125, 137, 150);
leds[61] = CRGB(0, 0, 0);
leds[62] = CRGB(0, 0, 0);
leds[63] = CRGB(0, 0, 0);
FastLED.show();
delay(500);

} while(z<10);
  leds[0] = CRGB(0, 0, 0);
leds[1] = CRGB(0, 0, 0);
leds[2] = CRGB(0, 0, 0);
leds[3] = CRGB(0, 0, 0);
leds[4] = CRGB(0, 0, 0);
leds[5] = CRGB(0, 0, 0);
leds[6] = CRGB(0, 0, 0);
leds[7] = CRGB(0, 0, 0);
leds[8] = CRGB(0, 0, 0);
leds[9] = CRGB(0, 0, 0);
leds[10] = CRGB(0, 0, 0);
leds[11] = CRGB(0, 0, 0);
leds[12] = CRGB(0, 0, 0);
leds[13] = CRGB(0, 0, 0);
leds[14] = CRGB(0, 0, 0);
leds[15] = CRGB(0, 0, 0);
leds[16] = CRGB(0, 0, 0);
leds[17] = CRGB(0, 0, 0);
leds[18] = CRGB(0, 0, 0);
leds[19] = CRGB(0, 0, 0);
leds[20] = CRGB(0, 0, 0);
leds[21] = CRGB(0, 0, 0);
leds[22] = CRGB(0, 0, 0);
leds[23] = CRGB(0, 0, 0);
leds[24] = CRGB(0, 0, 0);
leds[25] = CRGB(0, 0, 0);
leds[26] = CRGB(0, 0, 0);
leds[27] = CRGB(0, 0, 0);
leds[28] = CRGB(0, 0, 0);
leds[29] = CRGB(0, 0, 0);
leds[30] = CRGB(0, 0, 0);
leds[31] = CRGB(0, 0, 0);
leds[32] = CRGB(0, 0, 0);
leds[33] = CRGB(0, 0, 0);
leds[34] = CRGB(0, 0, 0);
leds[35] = CRGB(0, 0, 0);
leds[36] = CRGB(0, 0, 0);
leds[37] = CRGB(0, 0, 0);
leds[38] = CRGB(0, 0, 0);
leds[39] = CRGB(0, 0, 0);
leds[40] = CRGB(0, 0, 0);
leds[41] = CRGB(0, 0, 0);
leds[42] = CRGB(0, 0, 0);
leds[43] = CRGB(0, 0, 0);
leds[44] = CRGB(0, 0, 0);
leds[45] = CRGB(0, 0, 0);
leds[46] = CRGB(0, 0, 0);
leds[47] = CRGB(0, 0, 0);
leds[48] = CRGB(0, 0, 0);
leds[49] = CRGB(0, 0, 0);
leds[50] = CRGB(0, 0, 0);
leds[51] = CRGB(0, 0, 0);
leds[52] = CRGB(0, 0, 0);
leds[53] = CRGB(0, 0, 0);
leds[54] = CRGB(0, 0, 0);
leds[55] = CRGB(0, 0, 0);
leds[56] = CRGB(0, 0, 0);
leds[57] = CRGB(0, 0, 0);
leds[58] = CRGB(0, 0, 0);
leds[59] = CRGB(0, 0, 0);
leds[60] = CRGB(0, 0, 0);
leds[61] = CRGB(0, 0, 0);
leds[62] = CRGB(0, 0, 0);
leds[63] = CRGB(0, 0, 0);

FastLED.show();  }

    return;
  }  }

Folgende Zeilen müsst ihr noch anpassen

if (ircMessage.text == "!befehl")
      {
       
      sendTwitchMessage("Hier blinkt es");  
      Serial.println("LEDMatrix an");

<!befehl> hier gebt ihr den Befehl ein den man im Chat braucht um die LED Matrix zu aktivieren. Ich würde euch empfehlen unbedingt ein <!> vor den Befehl zu setzen damit die Matrix los geht wenn jemand in seiner Chat-Nachricht ausversehen das Auslösewort eingibt.

   sendTwitchMessage("Hier blinkt es");

Hier könnt ihr angeben was im Chat geschrieben wird wenn der Befehl ausgeführt wird und

Serial.println("LEDMatrix an");

gibt an was im Seriellen Monitor angezeigt wird wenn der Befehl ausgeführt wird.

Ich hoffe es war nicht zu konfus und ihr könnt mit der Anleitung was anfangen.

Der Code wurde etwas angepasst (16.02.2020)

Ich habe den Code heute etwas angepasst. Um nicht die lange Kette von <CRGB(0,0,0> zu schreiben wurde

FastLED.clear();
FastLED.show();

eingefügt. Das ganze sieht jetz wie folgt aus:

/*******************************************************************
    Connect to Twtich Chat with a Bot
   Created with code from TheOtherLoneStar (https://www.twitch.tv/theotherlonestar)
   Hackaday IO: https://hackaday.io/otherlonestar
   By Brian Lough (https://www.twitch.tv/brianlough)
   YouTube: https://www.youtube.com/channel/UCezJOfu7OtqGzd5xrP3q6WA
Created with code from noycebru www.twitch.tv/noycebru
 *******************************************************************/
 
#include <ESP8266WiFi.h>          //https://github.com/esp8266/Arduino
#include <IRCClient.h>
#include "FastLED.h"
 
//define your default values here, if there are different values in config.json, they are overwritten.
 
#define IRC_SERVER   "irc.chat.twitch.tv"
#define IRC_PORT     6667
#define NUM_LEDS 64
#define DATA_PIN D1

byte pixelType = 0;
char drawIn[4];
char frameIn[768];
//------- Replace the following! ------
char ssid[] = "xxx";       // your network SSID (name)
char password[] = "xxx";  // your network key
 
//The name of the channel that you want the bot to join
const String twitchChannelName = "xxx";
 
//The name that you want the bot to have
#define TWITCH_BOT_NAME "xxx"
 
//OAuth Key for your twitch bot
// https://twitchapps.com/tmi/
#define TWITCH_OAUTH_TOKEN "oauth:xxx"
 CRGB leds[NUM_LEDS];
 
//------------------------------
 
 
int led = D2;
String ircChannel = "";
 
WiFiClient wiFiClient;
IRCClient client(IRC_SERVER, IRC_PORT, wiFiClient);
 
// put your setup code here, to run once:
void setup() {
 FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
  pinMode(led, OUTPUT);
 
  Serial.begin(115200);
  Serial.println();
 
  // Set WiFi to station mode and disconnect from an AP if it was Previously
  // connected
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);
 
  // Attempt to connect to Wifi network:
  Serial.print("Connecting Wifi: ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    delay(500);
  }
  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  IPAddress ip = WiFi.localIP();
  Serial.println(ip);
 
  ircChannel = "#" + twitchChannelName;
 
  client.setCallback(callback);
}
 
void loop() {
 
  // Try to connect to chat. If it loses connection try again
  if (!client.connected()) {
    Serial.println("Attempting to connect to " + ircChannel );
    // Attempt to connect
    // Second param is not needed by Twtich
    if (client.connect(TWITCH_BOT_NAME, "", TWITCH_OAUTH_TOKEN)) {
      client.sendRaw("JOIN " + ircChannel);
      Serial.println("connected and ready to rock");
      sendTwitchMessage("Ready to go Boss!");
    } else {
      Serial.println("failed... try again in 5 seconds");
      // Wait 5 seconds before retrying
      delay(5000);
    }
    return;
  }
  client.loop();
  
}
 
void sendTwitchMessage(String message) {
  client.sendMessage(ircChannel, message);
}
 
 
void callback(IRCMessage ircMessage) {
  int z;
  //Serial.println("In CallBack");

  if (ircMessage.command == "PRIVMSG" && ircMessage.text[0] != '\001') {
    //Serial.println("Passed private message.");
   
    ircMessage.nick.toUpperCase();
 
    String message("<" + ircMessage.nick + "> " + ircMessage.text);
 
    //prints chat to serial
    Serial.println(message);
   
if (ircMessage.text == "!quack")
      {
       
      sendTwitchMessage("Das Geschnatter geht los");  
      Serial.println("Quack on");
      //duck
z = 1;
  do {
      Serial.println(z);
        z++;
leds[0] = CRGB(0, 0, 0);
leds[1] = CRGB(0, 0, 0);
leds[2] = CRGB(0, 0, 0);
leds[3] = CRGB(0, 0, 0);
leds[4] = CRGB(0, 0, 0);
leds[5] = CRGB(0, 0, 0);
leds[6] = CRGB(0, 0, 0);
leds[7] = CRGB(0, 0, 0);
leds[8] = CRGB(0, 0, 0);
leds[9] = CRGB(160, 161, 0);
leds[10] = CRGB(160, 161, 0);
leds[11] = CRGB(0, 0, 0);
leds[12] = CRGB(0, 0, 0);
leds[13] = CRGB(0, 0, 0);
leds[14] = CRGB(0, 0, 0);
leds[15] = CRGB(0, 0, 0);
leds[16] = CRGB(160, 161, 0);
leds[17] = CRGB(160, 161, 0);
leds[18] = CRGB(160, 161, 0);
leds[19] = CRGB(0, 0, 0);
leds[20] = CRGB(0, 0, 0);
leds[21] = CRGB(0, 0, 0);
leds[22] = CRGB(160, 161, 0);
leds[23] = CRGB(0, 0, 0);
leds[24] = CRGB(160, 161, 0);
leds[25] = CRGB(160, 161, 0);
leds[26] = CRGB(160, 161, 0);
leds[27] = CRGB(160, 161, 0);
leds[28] = CRGB(160, 161, 0);
leds[29] = CRGB(160, 161, 0);
leds[30] = CRGB(160, 161, 0);
leds[31] = CRGB(160, 161, 0);
leds[32] = CRGB(160, 161, 0);
leds[33] = CRGB(160, 161, 0);
leds[34] = CRGB(160, 161, 0);
leds[35] = CRGB(160, 161, 0);
leds[36] = CRGB(160, 161, 0);
leds[37] = CRGB(160, 161, 0);
leds[38] = CRGB(0, 0, 0);
leds[39] = CRGB(160, 161, 0);
leds[40] = CRGB(0, 0, 0);
leds[41] = CRGB(160, 161, 0);
leds[42] = CRGB(160, 161, 0);
leds[43] = CRGB(160, 161, 0);
leds[44] = CRGB(0, 0, 0);
leds[45] = CRGB(160, 161, 0);
leds[46] = CRGB(160, 161, 0);
leds[47] = CRGB(0, 0, 0);
leds[48] = CRGB(0, 0, 0);
leds[49] = CRGB(0, 0, 0);
leds[50] = CRGB(0, 0, 0);
leds[51] = CRGB(0, 0, 0);
leds[52] = CRGB(0, 0, 0);
leds[53] = CRGB(160, 161, 0);
leds[54] = CRGB(0, 0, 0);
leds[55] = CRGB(0, 0, 0);
leds[56] = CRGB(0, 0, 0);
leds[57] = CRGB(0, 0, 0);
leds[58] = CRGB(0, 0, 0);
leds[59] = CRGB(0, 0, 0);
leds[60] = CRGB(0, 0, 0);
leds[61] = CRGB(160, 161, 0);
leds[62] = CRGB(0, 0, 0);
leds[63] = CRGB(0, 0, 0);
FastLED.show();
delay(500);
leds[0] = CRGB(0, 0, 0);
leds[1] = CRGB(0, 0, 0);
leds[2] = CRGB(0, 0, 0);
leds[3] = CRGB(0, 0, 0);
leds[4] = CRGB(0, 0, 0);
leds[5] = CRGB(0, 0, 0);
leds[6] = CRGB(0, 0, 0);
leds[7] = CRGB(0, 0, 0);
leds[8] = CRGB(0, 0, 0);
leds[9] = CRGB(160, 161, 0);
leds[10] = CRGB(160, 161, 0);
leds[11] = CRGB(0, 0, 0);
leds[12] = CRGB(0, 0, 0);
leds[13] = CRGB(0, 0, 0);
leds[14] = CRGB(0, 0, 0);
leds[15] = CRGB(0, 0, 0);
leds[16] = CRGB(160, 161, 0);
leds[17] = CRGB(160, 161, 0);
leds[18] = CRGB(160, 161, 0);
leds[19] = CRGB(0, 0, 0);
leds[20] = CRGB(0, 0, 0);
leds[21] = CRGB(0, 0, 0);
leds[22] = CRGB(160, 161, 0);
leds[23] = CRGB(0, 0, 0);
leds[24] = CRGB(160, 161, 0);
leds[25] = CRGB(160, 161, 0);
leds[26] = CRGB(160, 161, 0);
leds[27] = CRGB(160, 161, 0);
leds[28] = CRGB(160, 161, 0);
leds[29] = CRGB(160, 161, 0);
leds[30] = CRGB(160, 161, 0);
leds[31] = CRGB(160, 161, 0);
leds[32] = CRGB(160, 161, 0);
leds[33] = CRGB(160, 161, 0);
leds[34] = CRGB(160, 161, 0);
leds[35] = CRGB(160, 161, 0);
leds[36] = CRGB(160, 161, 0);
leds[37] = CRGB(160, 161, 0);
leds[38] = CRGB(0, 0, 0);
leds[39] = CRGB(160, 161, 0);
leds[40] = CRGB(0, 0, 0);
leds[41] = CRGB(160, 161, 0);
leds[42] = CRGB(160, 161, 0);
leds[43] = CRGB(160, 161, 0);
leds[44] = CRGB(0, 0, 0);
leds[45] = CRGB(160, 161, 0);
leds[46] = CRGB(160, 161, 0);
leds[47] = CRGB(0, 0, 0);
leds[48] = CRGB(0, 0, 0);
leds[49] = CRGB(0, 0, 0);
leds[50] = CRGB(0, 0, 0);
leds[51] = CRGB(0, 0, 0);
leds[52] = CRGB(0, 0, 0);
leds[53] = CRGB(160, 161, 0);
leds[54] = CRGB(0, 0, 0);
leds[55] = CRGB(0, 0, 0);
leds[56] = CRGB(0, 0, 0);
leds[57] = CRGB(0, 0, 0);
leds[58] = CRGB(0, 0, 0);
leds[59] = CRGB(0, 0, 0);
leds[60] = CRGB(160, 161, 0);
leds[61] = CRGB(0, 0, 0);
leds[62] = CRGB(160, 161, 0);
leds[63] = CRGB(0, 0, 0);
FastLED.show();
delay(500);

}

while(z<10);
Serial.println("LEDs aus");
FastLED.clear();
FastLED.show();


    }

else if (ircMessage.text == "!alien")
      {
      sendTwitchMessage("#%$&%$!§");  
        z = 1;
  do {
      Serial.println(z);
        z++;
leds[0] = CRGB(0, 0, 0);
leds[1] = CRGB(0, 0, 0);
leds[2] = CRGB(0, 0, 0);
leds[3] = CRGB(0, 0, 0);
leds[4] = CRGB(0, 0, 0);
leds[5] = CRGB(0, 0, 0);
leds[6] = CRGB(0, 0, 0);
leds[7] = CRGB(0, 0, 0);
leds[8] = CRGB(0, 0, 0);
leds[9] = CRGB(0, 99, 219);
leds[10] = CRGB(0, 0, 0);
leds[11] = CRGB(0, 0, 0);
leds[12] = CRGB(0, 0, 0);
leds[13] = CRGB(0, 99, 219);
leds[14] = CRGB(0, 0, 0);
leds[15] = CRGB(0, 0, 0);
leds[16] = CRGB(0, 0, 0);
leds[17] = CRGB(0, 0, 0);
leds[18] = CRGB(0, 0, 0);
leds[19] = CRGB(0, 99, 219);
leds[20] = CRGB(0, 99, 219);
leds[21] = CRGB(0, 0, 0);
leds[22] = CRGB(0, 0, 0);
leds[23] = CRGB(0, 0, 0);
leds[24] = CRGB(0, 0, 0);
leds[25] = CRGB(0, 0, 0);
leds[26] = CRGB(0, 0, 0);
leds[27] = CRGB(0, 99, 219);
leds[28] = CRGB(0, 99, 219);
leds[29] = CRGB(0, 99, 219);
leds[30] = CRGB(0, 99, 219);
leds[31] = CRGB(0, 0, 0);
leds[32] = CRGB(0, 0, 0);
leds[33] = CRGB(0, 0, 0);
leds[34] = CRGB(0, 0, 0);
leds[35] = CRGB(0, 99, 219);
leds[36] = CRGB(0, 99, 219);
leds[37] = CRGB(0, 99, 219);
leds[38] = CRGB(0, 99, 219);
leds[39] = CRGB(0, 0, 0);
leds[40] = CRGB(0, 0, 0);
leds[41] = CRGB(0, 0, 0);
leds[42] = CRGB(0, 0, 0);
leds[43] = CRGB(0, 99, 219);
leds[44] = CRGB(0, 99, 219);
leds[45] = CRGB(0, 0, 0);
leds[46] = CRGB(0, 0, 0);
leds[47] = CRGB(0, 0, 0);
leds[48] = CRGB(0, 0, 0);
leds[49] = CRGB(0, 99, 219);
leds[50] = CRGB(0, 0, 0);
leds[51] = CRGB(0, 0, 0);
leds[52] = CRGB(0, 0, 0);
leds[53] = CRGB(0, 99, 219);
leds[54] = CRGB(0, 0, 0);
leds[55] = CRGB(0, 0, 0);
leds[56] = CRGB(0, 0, 0);
leds[57] = CRGB(0, 0, 0);
leds[58] = CRGB(0, 0, 0);
leds[59] = CRGB(0, 0, 0);
leds[60] = CRGB(0, 0, 0);
leds[61] = CRGB(0, 0, 0);
leds[62] = CRGB(0, 0, 0);
leds[63] = CRGB(0, 0, 0);
FastLED.show();
delay (500);
leds[0] = CRGB(0, 0, 0);
leds[1] = CRGB(0, 0, 0);
leds[2] = CRGB(0, 0, 0);
leds[3] = CRGB(0, 0, 0);
leds[4] = CRGB(0, 0, 0);
leds[5] = CRGB(0, 0, 0);
leds[6] = CRGB(0, 0, 0);
leds[7] = CRGB(0, 0, 0);
leds[8] = CRGB(0, 0, 0);
leds[9] = CRGB(0, 0, 0);
leds[10] = CRGB(0, 0, 255);
leds[11] = CRGB(0, 0, 0);
leds[12] = CRGB(0, 0, 255);
leds[13] = CRGB(0, 0, 0);
leds[14] = CRGB(0, 0, 0);
leds[15] = CRGB(0, 0, 0);
leds[16] = CRGB(0, 0, 0);
leds[17] = CRGB(0, 0, 0);
leds[18] = CRGB(0, 0, 0);
leds[19] = CRGB(0, 0, 255);
leds[20] = CRGB(0, 0, 255);
leds[21] = CRGB(0, 0, 0);
leds[22] = CRGB(0, 0, 0);
leds[23] = CRGB(0, 0, 0);
leds[24] = CRGB(0, 0, 0);
leds[25] = CRGB(0, 0, 0);
leds[26] = CRGB(0, 0, 0);
leds[27] = CRGB(0, 0, 255);
leds[28] = CRGB(0, 0, 255);
leds[29] = CRGB(0, 0, 255);
leds[30] = CRGB(0, 153, 197);
leds[31] = CRGB(0, 0, 0);
leds[32] = CRGB(0, 0, 0);
leds[33] = CRGB(0, 0, 0);
leds[34] = CRGB(0, 0, 0);
leds[35] = CRGB(0, 0, 255);
leds[36] = CRGB(0, 0, 255);
leds[37] = CRGB(0, 0, 255);
leds[38] = CRGB(0, 153, 197);
leds[39] = CRGB(0, 0, 0);
leds[40] = CRGB(0, 0, 0);
leds[41] = CRGB(0, 0, 0);
leds[42] = CRGB(0, 0, 0);
leds[43] = CRGB(0, 0, 255);
leds[44] = CRGB(0, 0, 255);
leds[45] = CRGB(0, 0, 0);
leds[46] = CRGB(0, 0, 0);
leds[47] = CRGB(0, 0, 0);
leds[48] = CRGB(0, 0, 0);
leds[49] = CRGB(0, 0, 0);
leds[50] = CRGB(0, 0, 255);
leds[51] = CRGB(0, 0, 0);
leds[52] = CRGB(0, 0, 255);
leds[53] = CRGB(0, 0, 0);
leds[54] = CRGB(0, 0, 0);
leds[55] = CRGB(0, 0, 0);
leds[56] = CRGB(0, 0, 0);
leds[57] = CRGB(0, 0, 0);
leds[58] = CRGB(0, 0, 0);
leds[59] = CRGB(0, 0, 0);
leds[60] = CRGB(0, 0, 0);
leds[61] = CRGB(0, 0, 0);
leds[62] = CRGB(0, 0, 0);
leds[63] = CRGB(0, 0, 0);
FastLED.show();
delay (500);
} while(z<10);
FastLED.clear();
FastLED.show();
     }else if (ircMessage.text == "!geist")
      {
      sendTwitchMessage("HuHuuuuu");  
        z = 1;
  do {
      Serial.println(z);
        z++;
        leds[0] = CRGB(0, 0, 0);
leds[1] = CRGB(0, 0, 0);
leds[2] = CRGB(0, 0, 0);
leds[3] = CRGB(0, 0, 0);
leds[4] = CRGB(0, 0, 0);
leds[5] = CRGB(0, 0, 0);
leds[6] = CRGB(0, 0, 0);
leds[7] = CRGB(0, 0, 0);
leds[8] = CRGB(0, 82, 83);
leds[9] = CRGB(0, 82, 83);
leds[10] = CRGB(0, 82, 83);
leds[11] = CRGB(0, 82, 83);
leds[12] = CRGB(0, 82, 83);
leds[13] = CRGB(0, 82, 83);
leds[14] = CRGB(0, 82, 83);
leds[15] = CRGB(0, 0, 0);
leds[16] = CRGB(0, 0, 0);
leds[17] = CRGB(0, 82, 83);
leds[18] = CRGB(0, 82, 83);
leds[19] = CRGB(0, 82, 83);
leds[20] = CRGB(0, 82, 83);
leds[21] = CRGB(0, 0, 0);
leds[22] = CRGB(0, 0, 0);
leds[23] = CRGB(0, 82, 83);
leds[24] = CRGB(0, 82, 83);
leds[25] = CRGB(0, 82, 83);
leds[26] = CRGB(0, 0, 0);
leds[27] = CRGB(0, 82, 83);
leds[28] = CRGB(0, 0, 0);
leds[29] = CRGB(0, 0, 0);
leds[30] = CRGB(0, 0, 0);
leds[31] = CRGB(0, 82, 83);
leds[32] = CRGB(0, 0, 0);
leds[33] = CRGB(0, 82, 83);
leds[34] = CRGB(0, 0, 0);
leds[35] = CRGB(0, 82, 83);
leds[36] = CRGB(0, 82, 83);
leds[37] = CRGB(0, 82, 83);
leds[38] = CRGB(0, 82, 83);
leds[39] = CRGB(0, 82, 83);
leds[40] = CRGB(0, 82, 83);
leds[41] = CRGB(0, 82, 83);
leds[42] = CRGB(0, 0, 0);
leds[43] = CRGB(0, 82, 83);
leds[44] = CRGB(0, 82, 83);
leds[45] = CRGB(0, 0, 0);
leds[46] = CRGB(0, 0, 0);
leds[47] = CRGB(0, 82, 83);
leds[48] = CRGB(0, 0, 0);
leds[49] = CRGB(0, 82, 83);
leds[50] = CRGB(0, 82, 83);
leds[51] = CRGB(0, 82, 83);
leds[52] = CRGB(0, 0, 0);
leds[53] = CRGB(0, 0, 0);
leds[54] = CRGB(0, 0, 0);
leds[55] = CRGB(0, 82, 83);
leds[56] = CRGB(0, 82, 83);
leds[57] = CRGB(0, 82, 83);
leds[58] = CRGB(0, 82, 83);
leds[59] = CRGB(0, 82, 83);
leds[60] = CRGB(0, 82, 83);
leds[61] = CRGB(0, 82, 83);
leds[62] = CRGB(0, 82, 83);
leds[63] = CRGB(0, 0, 0);
FastLED.show();
delay(500);
leds[0] = CRGB(0, 0, 0);
leds[1] = CRGB(0, 0, 0);
leds[2] = CRGB(0, 0, 0);
leds[3] = CRGB(0, 0, 0);
leds[4] = CRGB(0, 0, 0);
leds[5] = CRGB(0, 0, 0);
leds[6] = CRGB(0, 0, 0);
leds[7] = CRGB(0, 0, 0);
leds[8] = CRGB(0, 0, 0);
leds[9] = CRGB(0, 82, 83);
leds[10] = CRGB(0, 82, 83);
leds[11] = CRGB(0, 82, 83);
leds[12] = CRGB(0, 82, 83);
leds[13] = CRGB(0, 82, 83);
leds[14] = CRGB(0, 82, 83);
leds[15] = CRGB(0, 0, 0);
leds[16] = CRGB(0, 82, 83);
leds[17] = CRGB(0, 82, 83);
leds[18] = CRGB(0, 82, 83);
leds[19] = CRGB(0, 82, 83);
leds[20] = CRGB(0, 0, 0);
leds[21] = CRGB(0, 0, 0);
leds[22] = CRGB(0, 0, 0);
leds[23] = CRGB(0, 82, 83);
leds[24] = CRGB(0, 0, 0);
leds[25] = CRGB(0, 82, 83);
leds[26] = CRGB(0, 0, 0);
leds[27] = CRGB(0, 82, 83);
leds[28] = CRGB(0, 82, 83);
leds[29] = CRGB(0, 0, 0);
leds[30] = CRGB(0, 0, 0);
leds[31] = CRGB(0, 82, 83);
leds[32] = CRGB(0, 82, 83);
leds[33] = CRGB(0, 82, 83);
leds[34] = CRGB(0, 0, 0);
leds[35] = CRGB(0, 82, 83);
leds[36] = CRGB(0, 82, 83);
leds[37] = CRGB(0, 82, 83);
leds[38] = CRGB(0, 82, 83);
leds[39] = CRGB(0, 82, 83);
leds[40] = CRGB(0, 0, 0);
leds[41] = CRGB(0, 82, 83);
leds[42] = CRGB(0, 0, 0);
leds[43] = CRGB(0, 82, 83);
leds[44] = CRGB(0, 0, 0);
leds[45] = CRGB(0, 0, 0);
leds[46] = CRGB(0, 0, 0);
leds[47] = CRGB(0, 82, 83);
leds[48] = CRGB(0, 82, 83);
leds[49] = CRGB(0, 82, 83);
leds[50] = CRGB(0, 82, 83);
leds[51] = CRGB(0, 82, 83);
leds[52] = CRGB(0, 82, 83);
leds[53] = CRGB(0, 0, 0);
leds[54] = CRGB(0, 0, 0);
leds[55] = CRGB(0, 82, 83);
leds[56] = CRGB(0, 0, 0);
leds[57] = CRGB(0, 82, 83);
leds[58] = CRGB(0, 82, 83);
leds[59] = CRGB(0, 82, 83);
leds[60] = CRGB(0, 82, 83);
leds[61] = CRGB(0, 82, 83);
leds[62] = CRGB(0, 82, 83);
leds[63] = CRGB(0, 0, 0);
FastLED.show();
delay(500);
} while(z<10);
 FastLED.clear();
FastLED.show();

    return;
      }}   }

Bis dahin
Habt Spaß am basteln

Schreibe einen Kommentar

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

Durch die weitere Nutzung der Seite stimmst du der Verwendung von Cookies zu. Weitere Informationen

Die Cookie-Einstellungen auf dieser Website sind auf "Cookies zulassen" eingestellt, um das beste Surferlebnis zu ermöglichen. Wenn du diese Website ohne Änderung der Cookie-Einstellungen verwendest oder auf "Akzeptieren" klickst, erklärst du sich damit einverstanden.

Schließen