Code für WS2812b LED -

Und wo sind die Code-Tags?
So kann man das nicht sauber lesen.

Hier als Datei .. vom Handy ... :

Blinker1.ino.ino (1.57 KB)

jetzt dupliziere mal den Inhalt der loop als ganzen Block und setze die Werte für die LEDs auf 0....

und berichte deine Beobachtung.

DeepWater:
Hier als Datei .. vom Handy ... :

Ich versteh das nicht, wieso bringst du das nicht in Code-Tags.

Ich lade keine fremden Dateien auf meinen Rechner!

Und wo sind deine Anpassungen?

Ich habe die letzten Tage keinen entsprechenden Blinker gesehen, daher kann ich nur raten, wie der aussieht. Meine alte Reisschüssel hat Glühbirnchen, die man selbst noch tauschen kann! Sketch 163 für das Forum nach 2000 Beiträgen. Mit FastLED und APA102C, einem endlichen Automaten, Verzögerung durch millis() und Hardware-SPI:

#include "FastLED.h"
#define DATA_PIN    4
#define LED_TYPE    WS2812B
#define COLOR_ORDER GRB
/*
#define LED_TYPE    APA102
#define COLOR_ORDER BGR
*/
#define BRIGHTNESS  64
#define NUM_LEDS    10
#define Effektgrenze 6

const byte pinSchalterBlink = 2;
const byte pinSchalterWeiss = 3;
CRGB leds[NUM_LEDS];
unsigned long aktMillis, blinkMillis;
const unsigned long verzoegerungAusMillis = 300, blinkIntervall = 30;
unsigned int ledIdx;
enum {WARTEN, ANIMATION, VERZOEGERUNG};
byte zustand = WARTEN;

void setup() {
  pinMode(pinSchalterBlink, INPUT_PULLUP);
  pinMode(pinSchalterWeiss, INPUT_PULLUP);
  //  FastLED.addLeds<LED_TYPE, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);  // APA102  MOSI Pin11 an DIN; ACK  Pin13 an CIN
  FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);  // WS2812B
  FastLED.setBrightness(BRIGHTNESS);
  LEDS.showColor(CRGB(0, 0, 0));
}

void loop()
{
  aktMillis = millis();

  switch (zustand) {
    case WARTEN:
      if (digitalRead(pinSchalterBlink)) {
        blinkMillis = aktMillis;
        zustand = ANIMATION;
      }
      break;
    case ANIMATION:
      if (aktMillis - blinkMillis >= blinkIntervall) {
        blinkMillis = aktMillis;
        if (ledIdx < NUM_LEDS) {
          leds[ledIdx] = CRGB::Yellow;
          ledIdx++;
          weiss();
        } else {
          blinkMillis = aktMillis;
          zustand = VERZOEGERUNG;
        }
      }
      break;
    case VERZOEGERUNG:
      if (aktMillis - blinkMillis >= verzoegerungAusMillis) {
        for (ledIdx = 0; ledIdx < NUM_LEDS; ledIdx++) {
          leds[ledIdx] = CRGB::Black;
        }
        weiss();
        ledIdx = 0;
        zustand = WARTEN;
      }
      break;
  }
}

void weiss()
{
  if (digitalRead(pinSchalterWeiss)) {
    for (byte j = 0; j < Effektgrenze; j++) {
      leds[j] = CRGB::White;
    }
  }
  FastLED.show();
}

Ich hoffe, das bringt Dich weiter :grin:

MaHa76:
jetzt dupliziere mal den Inhalt der loop als ganzen Block und setze die Werte für die LEDs auf 0....

und berichte deine Beobachtung.

Der Tipp ist sehr hilfreich und ich hoffe jetzt kommt der TO damit klar und berichtet bald vom Erfolg.

beide fälle noch kein erfolg ... ich bleibe aber hart ... aber ich lerne dazu .. das ist schon mal ein erfolg ...

PN an agume gesendet ....

Was heißt kein Erfolg? Poste mal deinen modifizierten Sketch und teile uns deine Beobachtung mit.

Es wäre leicht dir den fertigen Sketch zu geben. Aber dann verpaßt du einiges. Man kann mit den Teilen verdammt viel machen. Aber nur wenn man das Grundprinzip verstanden hat.

Mit der Zeile (i = 0; i < maxLEDZahl, i++) schaltet dein Sketch z.b. bei jedem loop Durchlauf eine LED höher, so lange deren Position zwischen 0 und maxLEDZahl liegt.

Wenn man das verstanden hat kann man zum Beispiel die LED wo ein Effekt anfängt und aufhört abweichend definieren. Wenn man das weiß kann man auch eine LED die man zuvor eingeschaltet hat im nächsten Schritt wieder ausschalten.

Wir haben die Abition dir schrittweise an diese Geheimnise heranzuführen damit du Lust auf weitere Effekte bekommst. Schau mal bei Youtube was sich da einige Koreaner für Effekte mit Ringen in die Scheinwerfer zaubern... Dagegen sind die Audiblinker recht langweilig....

DeepWater:
beide fälle noch kein erfolg ... ich bleibe aber hart ... aber ich lerne dazu .. das ist schon mal ein erfolg ...

PN an agume gesendet ....

Dann solltest du dir ein anderes Hobby suchen.
Der Vorschlag von MaHa76 ist ganz sicher richtig und funktioniert.
Ich habe es eben selbst ausprobiert.
Poste doch mal deine Anpassungen.
Aber diesmal in Code-Tags.

keine Ahnung wie das mit diesen Code Tags geht ... ich wage mich das erste mal in foren ....

die Codetags findest du oben links über den Smilies </> sieht so aus- hab am Anfang auch ne Weile gebraucht die zu finden... :wink:

DeepWater:
keine Ahnung wie das mit diesen Code Tags geht ... ich wage mich das erste mal in foren ....

Und dafür gibt es auch eine Anleitung, geschrieben hatte ich das auch schon.
Also lesen solltest du schon unsere Posts.

// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
  #include <avr/power.h>
#endif

// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1
#define PIN            6

// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS      45

// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

int delayval = 10; // delay for half a second

void setup() {
  // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
  if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
  // End of trinket special code

  pixels.begin(); // This initializes the NeoPixel library.
}

void loop() {

  // For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.

  for(int i=0;i<NUMPIXELS;i++){

    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor(i, pixels.Color(255,70,0)); // Moderately bright green color.

    pixels.show(); // This sends the updated pixel color to the hardware.

    delay(delayval); // Delay for a period of time (in milliseconds).

  }
}

Das kann auch nicht funktionieren, du hast ja keine Anpassung daran vorgenommen.

Jetzt kopierst du alles was innerhalb der geschwungenen Klammern { } in der loop steht - und fügst es vor der letzten schließenden Klammer } der loop wieder ein und setzt alles in dieser Zeile:

pixels.setPixelColor(i, pixels.Color(255,70,0));

auf 0 - das sind nähmlich die Werte für die einzelnen Farben Rot, Grün und Blau - 0 ist aus und 255 ist der max Wert- die Zeile sieht dann so aus:

pixels.setPixelColor(i, pixels.Color(0,0,0));

also- du setzt es nur im 2. Abschnitt auf 0 im ersten bleibt alles wie gehabt...

Setze das ans Ende der Loop:

    delay(2000);
    for (int i = 0; i < NUMPIXELS; i++) {
    
    pixels.setPixelColor(i, pixels.Color(0, 0, 0)); // Moderately bright green color.

    pixels.show(); // This sends the updated pixel color to the hardware.

    delay(delayval); // Delay for a period of time (in milliseconds).

  }

Ups, da war einer schneller.

Ich versteh nicht, warum du unsere Beiträge ignorierst.

Du wärst schon viel weiter

und wir wollen helfen und nicht deine Programme schreiben.

// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif

// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1
#define PIN            6

// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS      45

// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

int delayval = 10; // delay for half a second

void setup() {
  // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
  if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
  // End of trinket special code

  pixels.begin(); // This initializes the NeoPixel library.
}

void loop() {

  // For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.

  for(int i=0;i<NUMPIXELS;i++){

    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor(i, pixels.Color(255,70,0)); 
    
    pixels.show(); // This sends the updated pixel color to the hardware.

    delay(delayval); // Delay for a period of time (in milliseconds).

    // For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.

  for(int i=0;i<NUMPIXELS;i++){

    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor(i, pixels.Color(0,0,0));

    pixels.show(); 

    delay(delayval); 
  }
    }
}

jetzt binkt einzeln jede led bis zur 45. hoch ... der Effekt ist verloren gegangen !

Fast.... eine der schließenden Klammern } gehört an das Ende des ersten Abschnitts- genau vor den Teil den du eingefügt hast...

JAAAAAAAAAAA !!!!!! FAST !!! ... die led gehen jetzt aber von der 1. bis zur 45. in schritten aus ...
sollten aber um den Audi Effekt zu bekommen ... wenn sie die 45. erreicht haben und alle leuchten .... auch dann alle ausgehen .....

wer erbarmt sich nochmal mit mir ... ! ich danke denen die sich bisher so toll eingesetzt haben ! ! !