Feuer simulieren mit ir Ferbedienung

Guten Abend liebe Gemeinde,

ich wende mich nochmals hoffnungsvoll an euch…..

ich habe vor mit einem 5m ws 2812 Streifen ein Feuer zu simulieren.

nachdem ich die codierung der Fernbedienung angepasst habe, macht der streifen gar nichts mehr……mit der alten fernbedienung lief alles super.

// Programmiert auf TV Fernbedienung Samsung


#include <Adafruit_NeoPixel.h>
#include <IRremote.h>

#define PIN        6  // Which pin on the Arduino is connected to the NeoPixels?
#define RECV_PIN 11  // define IR input pin on Arduino 
#define NUMPIXELS 300 // How many NeoPixels are attached to the Arduino? // Popular NeoPixel ring size

Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
IRrecv irrecv(RECV_PIN);
decode_results results; // decode_results class is defined in IRremote.h

long FirelastTime = 0;
long IRlastTime = 0;
long TimerlastTime = 0;
int interval;
long IRCode = 0;
long OLDIRCode = 0;
bool FireON = false;
bool FireOFF = false;
byte FireSequence = 0;

void setup()
{
  Serial.begin(9600);
  while (!Serial);   //wait until Serial is established - required on some Platforms
  irrecv.enableIRIn(); // Start the receiver
  pixels.begin(); // INITIALIZE NeoPixels
  pixels.show(); // Initialize all pixels to 'off'
  interval = 300;
  randomSeed(analogRead(0));
}

void SimulateFire (bool On, byte FireSq)
{
  byte LightValue[NUMPIXELS * 3];

  if (millis() - FirelastTime >= interval)
  {
    if (On)
    {
      FireOFF = false;
      FirelastTime = millis();
      interval = 200;
      if (FireSq == 1)
      {
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          LightValue[i * 3] = random(200, 255); // 250
          LightValue[i * 3 + 1] = random(30, 70); // 50
          LightValue[i * 3 + 2] = 0;
        }
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          pixels.setPixelColor(i, LightValue[i * 3], LightValue[i * 3 + 1], LightValue[i * 3 + 2]);
        }
        noInterrupts();
        pixels.show();   // Send the updated pixel colors to the hardware.
        interrupts();
      }
      if (FireSq == 2)
      {
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          pixels.setPixelColor(i, 250, 50, 0);
        }
        noInterrupts();
        pixels.show();   // Send the updated pixel colors to the hardware.
        interrupts();
      }
      if (FireSq == 3)
      {
        interval = random(50, 100);
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          LightValue[i * 3] = random(240, 255); // 250
          LightValue[i * 3 + 1] = random(30, 60); // 50
          LightValue[i * 3 + 2] = 0;
        }
        // Switch some lights out
        byte LightsOff  = random(0, 6);
        for (int i = 0; i < LightsOff; i++)
        {
          byte Selected = random(NUMPIXELS);
          LightValue[Selected * 3] = 0;
          LightValue[Selected * 3 + 1] = 0;
          LightValue[Selected * 3 + 2] = 0;
        }
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          pixels.setPixelColor(i, LightValue[i * 3], LightValue[i * 3 + 1], LightValue[i * 3 + 2]);
        }
        noInterrupts();
        pixels.show();   // Send the updated pixel colors to the hardware.
        interrupts();
      }
      if (FireSq == 4)
      {
        interval = random(80);
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          LightValue[i * 3] = 250; //random(240,255); // 250
          LightValue[i * 3 + 1] =  50; //random(30,60); // 50
          LightValue[i * 3 + 2] = 0;
        }
        // Switch some lights out if Chance Hit

        byte ChanceforLightsOff  = random(0, 40);
        if (ChanceforLightsOff > 35)
        {
          byte LightsOff  = random(5);
          for (int i = 0; i < LightsOff; i++)
          {
            byte Selected = random(NUMPIXELS);
            LightValue[Selected * 3] = 0;
            LightValue[Selected * 3 + 1] = 0;
            LightValue[Selected * 3 + 2] = 0;
          }
        }
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          pixels.setPixelColor(i, LightValue[i * 3], LightValue[i * 3 + 1], LightValue[i * 3 + 2]);
        }
        noInterrupts();
        pixels.show();   // Send the updated pixel colors to the hardware.
        interrupts();
      }
      if (FireSq == 5)
      {
        interval = random(150, 200);
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          LightValue[i * 3] = random(240, 255); // 250
          LightValue[i * 3 + 1] = random(30, 60); // 50
          LightValue[i * 3 + 2] = 0;
        }
        // Switch some lights darker
        byte LightsOff  = random(0, 4);
        for (int i = 0; i < LightsOff; i++)
        {
          byte Selected = random(NUMPIXELS);
          LightValue[Selected * 3] = random(50, 60);
          LightValue[Selected * 3 + 1] = random(5, 10);
          LightValue[Selected * 3 + 2] = 0;
        }
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          pixels.setPixelColor(i, LightValue[i * 3], LightValue[i * 3 + 1], LightValue[i * 3 + 2]);
        }
        noInterrupts();
        pixels.show();   // Send the updated pixel colors to the hardware.
        interrupts();
      }
      if (FireSq == 6)
      {
        interval = random(80);
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          LightValue[i * 3] = random(240, 255); // 250
          LightValue[i * 3 + 1] = random(40, 60); // 50
          LightValue[i * 3 + 2] = 0;
        }
        // Switch some lights out if Chance Hit
        byte ChanceforLightsOff  = random(0, 40);
        if (ChanceforLightsOff > 35)
        {
          byte LightsOff  = random(5);
          for (int i = 0; i < LightsOff; i++)
          {
            byte Selected = random(NUMPIXELS);
            LightValue[Selected * 3] = 0;
            LightValue[Selected * 3 + 1] = 0;
            LightValue[Selected * 3 + 2] = 0;
          }
        }
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          pixels.setPixelColor(i, LightValue[i * 3], LightValue[i * 3 + 1], LightValue[i * 3 + 2]);
        }
        noInterrupts();
        pixels.show();   // Send the updated pixel colors to the hardware.
        interrupts();
      }
    }
    else
    {
      if (!(FireOFF))
      {
        pixels.clear();
        noInterrupts();
        pixels.show();   // Send the updated pixel colors to the hardware.
        interrupts();
        FireOFF = true;
      }
    }
  }
}

long ReceiveIrCommand ()
{
  long result = 0;
  if (irrecv.decode(&results))
  {
    result = results.value;
    irrecv.resume(); // Receive the next value
    return result;
  }
  return 0 ;
}

void IRCommandProcessor (long IrCommand)
{
  if (IRCode == OLDIRCode) {
    TimerlastTime = millis(); //Some stuff about debouncing IR Remote
  }
  if (millis() - TimerlastTime >= 300) {
    OLDIRCode = 0 ; //Some stuff about debouncing IR Remote
  }
  if ((IRCode < -1) & (IRCode != OLDIRCode) & (IRCode > -3000000000) & (IRCode < -4000000000))  // Valid IR Signal Received
  {
    OLDIRCode = IRCode;                                           //Some stuff about debouncing IR Remote
    switch (IRCode)
    {
      case -3772784863:        // In my case 1  on my TV - Remote
        {
          FireON = !FireON;
          FireSequence = 1;
        }
        break;
      case -3772817503:        // In my case 2  on my TV - Remote
        {
          FireON = !FireON;
          FireSequence = 2;
        }
        break;
      case -3772801183:        // In my case 3  on my TV - Remote
        {
          FireON = !FireON;
          FireSequence = 3;
        }
        break;
      case -3772780783:        // In my case 4  on my TV - Remote
        {
          FireON = !FireON;
          FireSequence = 4;
        }
        break;
      case -3772813423:        // In my case 5  on my TV - Remote
        {
          FireON = !FireON;
          FireSequence = 5;
        }
        break;
      case -3772797103:        // In my case 6  on my TV - Remote
        {
          FireON = !FireON;
          FireSequence = 6;
        }
        break;

      default:
        Serial.println(IRCode);
        break;
    }
  }
}

void loop()
{
  IRCode = ReceiveIrCommand();
  IRCommandProcessor(IRCode);
  SimulateFire(FireON, FireSequence);
}

ich habe nicht am code geändert, außer die ir codes und die baudrate

Warum verwendest du nicht weiterhin die funktionierende Fernbedienung ?
Evtl. ist die "neue" Fernbedienung nicht kompatibel zu deinem Empfänger oder Code.

Und was hat dein TV mit dem Led Stripe zu tun ?

die gibt es nicht mehr da der hund hunger hatte :wink:

ich habe mir eine neue gekauft und nutze diese nur zu halloween um alle sachen mit einer fernbedienung schalten zu können der tv hat damit gar nichts zu tun

Und warum steht es in den Kommentaren ?
Oder soll uns das nur in die Irre führen ?
Also ist die FB nicht kompatibel.

Mit welchem Empfänger hast du denn diese IR-Code aufgenommen ?

Welche Version von IRRemote wird denn verwendet?

in den Kommentaren steht nur dass ich die codes auf die neue fb angepasst habe

ich benutze einen “js1638”

und signale kann ich ja lesen nur kommen ständig andere codes raus….

die 4.5.0

Das steht in deinen Kommentaren.

Aber ok, ist nicht mein Problem.

TV-Remote das ist die taste 1 auf der fernbedienung ( TV Fernbedienung)

wie gesagt meine alte Fernbedienung hat der hund zerkaut.

damit lief das Programm ohne probleme

dann habe ich mir eine neue fernbedienung bestellt und mit der geht gar nichts mehr (die IR signale habe ich neu ausgelesen über den seriellen monitor und angepasst aber er schaltet die streifen nicht ein……)

Jo, Dein Code passt nicht zur verwendeten Version von IRRemote:

Es ist mal mindestens die falsche Headerdatei eingebunden....
result ist im Strukturmember IrReceiver.decodedIRData.command enthalten.

Einfaches Beispiel (NEC Protokoll):

uint16_t irReceive() {
  uint16_t received{0};

  if (IrReceiver.decode()) {
    //IrReceiver.printIRResultShort(&Serial);
    // if (IrReceiver.decodedIRData.protocol == UNKNOWN) {
    //   // We have an unknown protocol here, print more info
    //   IrReceiver.printIRResultRawFormatted(&Serial, true);
    // }
    if (IrReceiver.decodedIRData.protocol == NEC) {
      received = IrReceiver.decodedIRData.command;
      //Serial.print("Command: 0x");
      //Serial.println(received, HEX);
    }
    IrReceiver.resume();
  }
  return received;
}

Weiteres ist auf der oben verlinkten Seite beschrieben....

#include <Adafruit_NeoPixel.h>
#include <IRremote.hpp>

#define PIN        3  // Which pin on the Arduino is connected to the NeoPixels?
#define IR_RECEIVE_PIN 9 // define IR input pin on Arduino 
#define NUMPIXELS 300 // How many NeoPixels are attached to the Arduino? // Popular NeoPixel ring size

Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

long FirelastTime = 0;
long IRlastTime = 0;
long TimerlastTime = 0;
int interval;
long IRCode = 0;
long OLDIRCode = 0;
bool FireON = false;
bool FireOFF = false;
byte FireSequence = 0;

void setup()
{
  Serial.begin(115200);
  while (!Serial);   //wait until Serial is established - required on some Platforms
  IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK); // Start the receiver
  pixels.begin(); // INITIALIZE NeoPixels
  pixels.show(); // Initialize all pixels to 'off'
  interval = 300;
  randomSeed(analogRead(0));
}

void SimulateFire (bool On, byte FireSq)
{
  byte LightValue[NUMPIXELS * 3];

  if (millis() - FirelastTime >= interval)
  {
    if (On)
    {
      FireOFF = false;
      FirelastTime = millis();
      interval = 200;
      if (FireSq == 1)
      {
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          LightValue[i * 3] = random(200, 255); // 250
          LightValue[i * 3 + 1] = random(30, 70); // 50
          LightValue[i * 3 + 2] = 0;
        }
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          pixels.setPixelColor(i, LightValue[i * 3], LightValue[i * 3 + 1], LightValue[i * 3 + 2]);
        }
        noInterrupts();
        pixels.show();   // Send the updated pixel colors to the hardware.
        interrupts();
      }
      if (FireSq == 2)
      {
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          pixels.setPixelColor(i, 250, 50, 0);
        }
        noInterrupts();
        pixels.show();   // Send the updated pixel colors to the hardware.
        interrupts();
      }
      if (FireSq == 3)
      {
        interval = random(50, 100);
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          LightValue[i * 3] = random(240, 255); // 250
          LightValue[i * 3 + 1] = random(30, 60); // 50
          LightValue[i * 3 + 2] = 0;
        }
        // Switch some lights out
        byte LightsOff  = random(0, 6);
        for (int i = 0; i < LightsOff; i++)
        {
          byte Selected = random(NUMPIXELS);
          LightValue[Selected * 3] = 0;
          LightValue[Selected * 3 + 1] = 0;
          LightValue[Selected * 3 + 2] = 0;
        }
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          pixels.setPixelColor(i, LightValue[i * 3], LightValue[i * 3 + 1], LightValue[i * 3 + 2]);
        }
        noInterrupts();
        pixels.show();   // Send the updated pixel colors to the hardware.
        interrupts();
      }
      if (FireSq == 4)
      {
        interval = random(80);
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          LightValue[i * 3] = 250; //random(240,255); // 250
          LightValue[i * 3 + 1] =  50; //random(30,60); // 50
          LightValue[i * 3 + 2] = 0;
        }
        // Switch some lights out if Chance Hit

        byte ChanceforLightsOff  = random(0, 40);
        if (ChanceforLightsOff > 35)
        {
          byte LightsOff  = random(5);
          for (int i = 0; i < LightsOff; i++)
          {
            byte Selected = random(NUMPIXELS);
            LightValue[Selected * 3] = 0;
            LightValue[Selected * 3 + 1] = 0;
            LightValue[Selected * 3 + 2] = 0;
          }
        }
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          pixels.setPixelColor(i, LightValue[i * 3], LightValue[i * 3 + 1], LightValue[i * 3 + 2]);
        }
        noInterrupts();
        pixels.show();   // Send the updated pixel colors to the hardware.
        interrupts();
      }
      if (FireSq == 5)
      {
        interval = random(150, 200);
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          LightValue[i * 3] = random(240, 255); // 250
          LightValue[i * 3 + 1] = random(30, 60); // 50
          LightValue[i * 3 + 2] = 0;
        }
        // Switch some lights darker
        byte LightsOff  = random(0, 4);
        for (int i = 0; i < LightsOff; i++)
        {
          byte Selected = random(NUMPIXELS);
          LightValue[Selected * 3] = random(50, 60);
          LightValue[Selected * 3 + 1] = random(5, 10);
          LightValue[Selected * 3 + 2] = 0;
        }
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          pixels.setPixelColor(i, LightValue[i * 3], LightValue[i * 3 + 1], LightValue[i * 3 + 2]);
        }
        noInterrupts();
        pixels.show();   // Send the updated pixel colors to the hardware.
        interrupts();
      }
      if (FireSq == 6)
      {
        interval = random(80);
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          LightValue[i * 3] = random(240, 255); // 250
          LightValue[i * 3 + 1] = random(40, 60); // 50
          LightValue[i * 3 + 2] = 0;
        }
        // Switch some lights out if Chance Hit
        byte ChanceforLightsOff  = random(0, 40);
        if (ChanceforLightsOff > 35)
        {
          byte LightsOff  = random(5);
          for (int i = 0; i < LightsOff; i++)
          {
            byte Selected = random(NUMPIXELS);
            LightValue[Selected * 3] = 0;
            LightValue[Selected * 3 + 1] = 0;
            LightValue[Selected * 3 + 2] = 0;
          }
        }
        for (int i = 0; i < NUMPIXELS; i++)
        { // For each pixel...
          pixels.setPixelColor(i, LightValue[i * 3], LightValue[i * 3 + 1], LightValue[i * 3 + 2]);
        }
        noInterrupts();
        pixels.show();   // Send the updated pixel colors to the hardware.
        interrupts();
      }
    }
    else
    {
      if (!(FireOFF))
      {
        pixels.clear();
        noInterrupts();
        pixels.show();   // Send the updated pixel colors to the hardware.
        interrupts();
        FireOFF = true;
      }
    }
  }
}

long ReceiveIrCommand ()
{
  long result = 0;
  if (IrReceiver.decode())
  {
    IrReceiver.resume(); // Receive the next value
    return result;
  }
  return 0 ;
}

void IRCommandProcessor (long IrCommand)
{
  if (IRCode == OLDIRCode) {
    TimerlastTime = millis(); //Some stuff about debouncing IR Remote
  }
  if (millis() - TimerlastTime >= 300) {
    OLDIRCode = 0 ; //Some stuff about debouncing IR Remote
  }
  if ((IRCode < -1) & (IRCode != OLDIRCode)) // Valid IR Signal Received
  {
    OLDIRCode = IRCode;                                           //Some stuff about debouncing IR Remote
    switch (IRCode)
    {
      case -522182433:        // In my case 1  on my TV - Remote
        {
          FireON = !FireON;
          FireSequence = 1;
        }
        break;
      case -522149793:        // In my case 2  on my TV - Remote
        {
          FireON = !FireON;
          FireSequence = 2;
        }
        break;
      case -522166113:        // In my case 3  on my TV - Remote
        {
          FireON = !FireON;
          FireSequence = 3;
        }
        break;
      case -522186513:        // In my case 4  on my TV - Remote
        {
          FireON = !FireON;
          FireSequence = 4;
        }
        break;
      case -522153873:        // In my case 5  on my TV - Remote
        {
          FireON = !FireON;
          FireSequence = 5;
        }
        break;
      case -522170193:        // In my case 6  on my TV - Remote
        {
          FireON = !FireON;
          FireSequence = 6;
        }
        break;

      default:
        Serial.println(IrReceiver.decodedIRData.decodedRawData, HEX); // Print "old" raw data
        IrReceiver.printIRResultShort(&Serial); // Print complete received data in one line
        IrReceiver.printIRSendUsage(&Serial);   // Print the statement required to send this data
        break;
    }
  }
}

void loop()
{
  IRCode = ReceiveIrCommand();
  IRCommandProcessor(IRCode);
  SimulateFire(FireON, FireSequence);
}

ich hab die befehle jetzt angepasst aber etwas machen tut er jetzt immer noch nicht……er zeigt mkr nichtmal mehr etwas im seriellen monitor an

Deine ReceiveIrCommand() Funktion ist immer noch unvollständig. Darum hatte ich den Beispielcode gepostet. Welches Protokoll „spricht“ die Fernbedienung bzw. was verwendest Du für eine?

So eine:

oder etwas anderes?

Wie ich dich verstanden habe, möchtest du doch die Leds damit steuern. Also schreibe da doch bitte richtig passende Kommentare rein, damit jeder erkennen kann, was passieren soll. So ist das Müll, weil es nicht passt.

so eine

ich verstehe dieses nec Protokoll nicht ich bin mehr oder weniger laie was das programmieren angeht und wusel mich so durch

ja richtig leds will ich ansprechen jedoch ist dieser kommentar so geint, dass “fall ich drücke taste 1 auf der tv fernbedienung” Kommt der angegebene code raus…..

Das sieht so aus, als wäre das eine Samsung Fernbedienung.

Installiere doch mal folgenden Code:


// #define DECODE_SAMSUNG
#define EXCLUDE_UNIVERSAL_PROTOCOLS   // Saves up to 1000 bytes program space.
#define EXCLUDE_EXOTIC_PROTOCOLS      // saves around 650 bytes program space if all other protocols are active
#define IR_RECEIVE_PIN 9              // (Default is 2)
#include <IRremote.hpp>

void setup() {
  Serial.begin(115200);
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) || defined(ARDUINO_attiny3217)
  delay(1000);
#endif
  Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
  Serial.println(F("Enabling IRin..."));
  IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
  Serial.print(F("Ready to receive IR signals of protocols: "));
  printActiveIRProtocols(&Serial);
  Serial.print(F("at pin "));
  Serial.println(IR_RECEIVE_PIN);
}

void loop() {

  if (IrReceiver.decode()) {

    if (IrReceiver.decodedIRData.protocol == UNKNOWN) {
      // We have an unknown protocol here, print more info
      IrReceiver.printIRResultRawFormatted(&Serial, true);
    } else {
      IrReceiver.printIRResultShort(&Serial);
      if (IrReceiver.decodedIRData.command == 0) { Serial.println(""); }
    }
    IrReceiver.resume();
  }
}

Da müsste dann eine Ausgabe in der Art kommen:

␁Protocol=Sony Address=0x1 Command=0x1 Raw-Data=0x81 12 bits LSB first Gap=26750us Duration=17850us
␁Protocol=Sony Address=0x1 Command=0x2 Raw-Data=0x82 12 bits LSB first Gap=516250us Duration=17850us
␂Protocol=Sony Address=0x1 Command=0x2 Raw-Data=0x82 12 bits LSB first Gap=26700us Duration=17900us
␂Protocol=Sony Address=0x1 Command=0x2 Raw-Data=0x82 12 bits LSB first Gap=26700us Duration=17850us
␂Protocol=Sony Address=0x1 Command=0x2 Raw-Data=0x82 12 bits LSB first Gap=26750us Duration=17850us
␂Protocol=Sony Address=0x1 Command=0x2 Raw-Data=0x82 12 bits LSB first Gap=26750us Duration=17850us
␂Protocol=Sony Address=0x1 Command=0x2 Raw-Data=0x82 12 bits LSB first Gap=26800us Duration=17850us
␂Protocol=Sony Address=0x1 Command=0x5 Raw-Data=0x85 12 bits LSB first Gap=647950us Duration=18450us
␅Protocol=Sony Address=0x1 Command=0x5 Raw-Data=0x85 12 bits LSB first Gap=26100us Duration=18450us
␅Protocol=Sony Address=0x1 Command=0x5 Raw-Data=0x85 12 bits LSB first Gap=26150us Duration=18450us
␅Protocol=Sony Address=0x1 Command=0x5 Raw-Data=0x85 12 bits LSB first Gap=26150us Duration=18450us
␅Protocol=Sony Address=0x1 Command=0x5 Raw-Data=0x85 12 bits LSB first Gap=26150us Duration=18450us
␅Protocol=Sony Address=0x1 Command=0x8 Raw-Data=0x88 12 bits LSB first Gap=747650us Duration=17850us
Protocol=Sony Address=0x1 Command=0x8 Raw-Data=0x88 12 bits LSB first Gap=26700us Duration=17850us
Protocol=Sony Address=0x1 Command=0x8 Raw-Data=0x88 12 bits LSB first Gap=26750us Duration=17850us
Protocol=Sony Address=0x1 Command=0x8 Raw-Data=0x88 12 bits LSB first Gap=26750us Duration=17850us

Ich habe keine Samsung Fernbedienung. Darum steht da Sony....
Entscheidend sind die "Command" Werte. Die brauchst Du später für Deine IRCommandProcessor() Funktion. Die bisher verwendeten Werte dürften hinfällig sein.

Ich habe den Code mal etwas umgemodelt. Der Ursprüngliche hatte doch einige Warnings und etwas Durcheinander bei den Datentypen. Da ich nur eine 64er LED habe und die Fernbedienung eine Sony ist, passt das nicht so ganz für Dich.

Die NumPixels müssen wieder auf 300 gesetzt werden und der Fernbedienungstyp von DECODE_SONY auf DECODE_SAMSUNG geändert werden.

Außerdem musst Du die Codes für die Tasten 1 bis 6 neu auslesen und die Pinnummern an Deine Schaltung anpassen.

Edit:

Ich habe den Code jetzt auf eine Samsung Fernbedienung angepasst. Du muss jetzt eigentlich nur noch die passenden Pinnummern wieder angeben (im namespace gc Bereich)

#include <Adafruit_NeoPixel.h>

#define DECODE_SAMSUNG
// #define DECODE_SONY
#define RAW_BUFFER_LENGTH 100
#define EXCLUDE_UNIVERSAL_PROTOCOLS   // Saves up to 1000 bytes program space.
#define EXCLUDE_EXOTIC_PROTOCOLS      // saves around 650 bytes program space if all other protocols are active
#include <IRremote.hpp>

using Millis_t = decltype(millis());
using IrCommand_t = decltype(IrReceiver.decodedIRData.command);

namespace gc {
constexpr uint8_t neoPixelPin {8};     // Which on the Arduino is connected to the NeoPixels?
constexpr uint8_t irReceiverPin {9};   // define IR input  on Arduino
constexpr size_t numPixels {300};      // How many NeoPixels are attached to the Arduino?
constexpr Millis_t remodeDebounce_ms {300};
constexpr Millis_t sequenceDelay_ms {250};
}   // namespace gc

class Timer {
public:
  void start() { timestamp = millis(); }
  bool operator()(const Millis_t duration) const { return millis() - timestamp >= duration; }

private:
  Millis_t timestamp {0};
};

struct FireEnvironment_t {
//                              T1      T2      T3      T4     T5       T6
#if defined(DECODE_SAMSUNG)
  const IrCommand_t irCodes[6] {0x0704, 0x0705, 0x0706, 0x0708, 0x0709, 0x070A};   // Samsung
#elif defined(DECODE_SONY)
  const IrCommand_t irCodes[6] {0x0100, 0x0101, 0x0102, 0x0103, 0x0104, 0x0105};   // Sony
#endif
  const size_t numIrCodes {sizeof(irCodes) / sizeof(irCodes[0])};
  const size_t numPixels {gc::numPixels};
  IrCommand_t irCmd;
  IrCommand_t oldIrCmd;
  uint8_t lightValue[gc::numPixels * 3 + 2];
  uint8_t sequence {0};
  bool fireON {false};
  bool fireOFF {false};
  Millis_t interval {gc::sequenceDelay_ms};
  Timer sequenceTimer;
} fireEnvironment;

Adafruit_NeoPixel pixels(gc::numPixels, gc::neoPixelPin, NEO_GRB + NEO_KHZ800);
Timer remoteDebounceTimer;

inline void showLED(Adafruit_NeoPixel& px) {
  noInterrupts();
  px.show();
  interrupts();
}

void setPixelLightValues(Adafruit_NeoPixel& px, FireEnvironment_t& fireEnv) {
  for (size_t i {0}; i < fireEnv.numPixels; ++i) {
    px.setPixelColor(i, fireEnv.lightValue[i * 3], fireEnv.lightValue[i * 3 + 1], fireEnv.lightValue[i * 3 + 2]);
  }
}

void selectSequence(Adafruit_NeoPixel& px, FireEnvironment_t& fireEnv) {
  switch (fireEnv.sequence) {
    case 0:
      fireEnv.interval = gc::sequenceDelay_ms;
      for (size_t i {0}; i < fireEnv.numPixels; ++i) {    // For each pixel...
        fireEnv.lightValue[i * 3] = random(200, 255);     // 250
        fireEnv.lightValue[i * 3 + 1] = random(30, 70);   // 50
        fireEnv.lightValue[i * 3 + 2] = 0;
      }
      setPixelLightValues(px, fireEnv);
      break;
    case 1:
      for (size_t i {0}; i < fireEnv.numPixels; ++i) {   // For each pixel...
        px.setPixelColor(i, 250, 50, 0);
      }
      break;
    case 2: {
      fireEnv.interval = random(50, 100);
      for (size_t i {0}; i < fireEnv.numPixels; ++i) {    // For each pixel...
        fireEnv.lightValue[i * 3] = random(240, 255);     // 250
        fireEnv.lightValue[i * 3 + 1] = random(30, 60);   // 50
        fireEnv.lightValue[i * 3 + 2] = 0;
      }
      // Switch some lights out
      uint8_t LightsOff = random(0, 6);
      for (size_t i {0}; i < LightsOff; ++i) {
        byte Selected = random(fireEnv.numPixels);
        fireEnv.lightValue[Selected * 3] = 0;
        fireEnv.lightValue[Selected * 3 + 1] = 0;
        fireEnv.lightValue[Selected * 3 + 2] = 0;
      }
      setPixelLightValues(px, fireEnv);
    } break;
    case 3: {
      fireEnv.interval = random(80);
      for (size_t i {0}; i < fireEnv.numPixels; ++i) {   // For each pixel...
        fireEnv.lightValue[i * 3] = 250;                 // random(240,255); // 250
        fireEnv.lightValue[i * 3 + 1] = 50;              // random(30,60); // 50
        fireEnv.lightValue[i * 3 + 2] = 0;
      }
      // Switch some lights out if Chance Hit

      uint8_t ChanceForLightsOff = random(0, 40);
      if (ChanceForLightsOff > 35) {
        byte LightsOff = random(5);
        for (size_t i {0}; i < LightsOff; ++i) {
          byte Selected = random(fireEnv.numPixels);
          fireEnv.lightValue[Selected * 3] = 0;
          fireEnv.lightValue[Selected * 3 + 1] = 0;
          fireEnv.lightValue[Selected * 3 + 2] = 0;
        }
      }
      setPixelLightValues(px, fireEnv);
    } break;
    case 4: {
      fireEnv.interval = random(150, 200);
      for (size_t i {0}; i < fireEnv.numPixels; ++i) {    // For each pixel...
        fireEnv.lightValue[i * 3] = random(240, 255);     // 250
        fireEnv.lightValue[i * 3 + 1] = random(30, 60);   // 50
        fireEnv.lightValue[i * 3 + 2] = 0;
      }
      // Switch some lights darker
      uint8_t LightsOff = random(0, 4);
      for (size_t i {0}; i < LightsOff; ++i) {
        byte Selected = random(fireEnv.numPixels);
        fireEnv.lightValue[Selected * 3] = random(50, 60);
        fireEnv.lightValue[Selected * 3 + 1] = random(5, 10);
        fireEnv.lightValue[Selected * 3 + 2] = 0;
      }
      setPixelLightValues(px, fireEnv);
    } break;
    case 5: {
      fireEnv.interval = random(80);
      for (size_t i {0}; i < fireEnv.numPixels; ++i) {    // For each pixel...
        fireEnv.lightValue[i * 3] = random(240, 255);     // 250
        fireEnv.lightValue[i * 3 + 1] = random(40, 60);   // 50
        fireEnv.lightValue[i * 3 + 2] = 0;
      }
      // Switch some lights out if Chance Hit
      uint8_t ChanceForLightsOff = random(0, 40);
      if (ChanceForLightsOff > 35) {
        byte LightsOff = random(5);
        for (size_t i {0}; i < LightsOff; ++i) {
          byte Selected = random(fireEnv.numPixels);
          fireEnv.lightValue[Selected * 3] = 0;
          fireEnv.lightValue[Selected * 3 + 1] = 0;
          fireEnv.lightValue[Selected * 3 + 2] = 0;
        }
      }
      setPixelLightValues(px, fireEnv);
    } break;
    default: fireEnv.fireON = false; break;   // switch off if not existing sequence number is given.
  }
}

void simulateFire(IRrecv& irRcv, Adafruit_NeoPixel& px, FireEnvironment_t& fireEnv) {
  if (fireEnv.sequenceTimer(fireEnv.interval)) {
    if (fireEnv.fireON) {
      fireEnv.sequenceTimer.start();
      fireEnv.fireOFF = false;
      selectSequence(px, fireEnv);
      // https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#problems-with-neopixels-fastled-etc
      if (irRcv.isIdle()) { showLED(px); }
    } else if (!fireEnv.fireOFF && irRcv.isIdle()) {
      px.clear();
      showLED(px);
      fireEnv.fireOFF = true;
    }
  }
}

IrCommand_t receiveIrCommand(IRrecv& irRcv) {
  IrCommand_t command {0};
  if (irRcv.decode()) {
    command = (irRcv.decodedIRData.address << 8) + irRcv.decodedIRData.command;
    irRcv.resume();
    // Serial.println(Command,HEX);
  }
  return command;
}

void irCommandProcessor(IRrecv& irRcv, FireEnvironment_t& fireEnv, Timer& wait) {
  bool isKnownCode {false};
  if (fireEnv.irCmd == fireEnv.oldIrCmd) { wait.start(); }   // Start debouncetimer
  if (fireEnv.irCmd && fireEnv.irCmd != fireEnv.oldIrCmd)    // Valid new IR Signal Received
  {
    fireEnv.oldIrCmd = fireEnv.irCmd;
    for (size_t i {0}; i < fireEnv.numIrCodes; ++i) {
      if (fireEnv.irCodes[i] == fireEnv.irCmd) {
        fireEnv.sequence = i;
        fireEnv.fireON = !fireEnv.fireON;
        isKnownCode = true;
      }
    }
    if (!isKnownCode) { irRcv.printIRResultShort(&Serial); }
  }
  if (wait(gc::remodeDebounce_ms)) { fireEnv.oldIrCmd = 0; }   // Some stuff about debouncing IR Remote
}

void setup() {
  Serial.begin(115200);
  while (!Serial);                       // Wait until Serial is established - required on some Platforms
  IrReceiver.begin(gc::irReceiverPin);   // Start the receiver
  pixels.begin();                        // Initialize NeoPixels
  pixels.setBrightness(50);
  pixels.show();                         // Set all pixels to 'off'
  randomSeed(analogRead(0));
}

void loop() {
  fireEnvironment.irCmd = receiveIrCommand(IrReceiver);
  irCommandProcessor(IrReceiver, fireEnvironment, remoteDebounceTimer);
  simulateFire(IrReceiver, pixels, fireEnvironment);
}

vielen lieben dank,

ich werde es später mal ausprobieren bin noch auf Montage und hab nichts mitgenommen spätestens am Wochenende werde ich versuchen das ding ans laufen zu bekommen.

ich habe mich ein wenig in die Thematik reingelesen und mir raucht immer noch der Kopf :see_no_evil_monkey: