Neopixel chase with yellow to red gradient

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
rjenn2
 
Posts: 8
Joined: Thu Sep 22, 2022 3:22 pm

Neopixel chase with yellow to red gradient

Post by rjenn2 »

Using a neopixel ring, I am hoping to light each LED one by one, chasing around in a circular pattern and slowly fading from yellow to red. I have tried the below code, but it is only lighting up the first neopixel. I could use some advice on where I am going wrong. Thanks!

Code: Select all

#include <Adafruit_NeoPixel.h>

Adafruit_NeoPixel strip = Adafruit_NeoPixel(12, 2, NEO_GRB + NEO_KHZ800);

void setup() {
strip.begin();
strip.show();
}

void loop() {

  for (int x=0; x<=12; x++){
    for (int y=255; y>0; y--){
      uint32_t yellow = strip.Color(255, y, 0);
      strip.setPixelColor(x, yellow);
      strip.show();
    }
  }
  }

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Neopixel chase with yellow to red gradient

Post by mikeysklar »

What is the Adafruit product number of the NeoPixel ring? Sometimes when only one lights up it means you are initializing for the wrong type of NeoPixel device (eg. RGB, GRB vs RGBW).

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”