Qdeathstar:
I would start by renaming all your variables to something meaningful. I have no idea what c stands for.
you should use a timer to change the color variables, and update the leds every time through the loop. In short, don’t use delay.
Using millis() for timing. A beginners guide - Introductory Tutorials - Arduino Forum
You can also look at those “blink without delay” example from the arduino ide sample sketches,
Thank you for your answer , I tried using this method but unfortunately the led strip is still blinking
here is the code :
unsigned long startMillis; //some global variables available anywhere in the program
unsigned long currentMillis;
const unsigned long period = 100; //the value is a number of milliseconds
const byte ledPin = 13; //using the built in LED
#include <FastLED.h>
#define DATA_PIN 3
#define CLOCK_PIN 4
#define NUM_LEDS 50
#define LED_COUNT 256
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
int i;
int x;
int colorStep;
int shift_RGB_couple;
int m;
int n;
int p;
int r;
int g;
int b;
void setup(){
FastLED.addLeds<P9813, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
Serial.begin(115200); //start Serial in case we need to print debugging info
startMillis = millis(); //initial start time
}
void loop(){
currentMillis = millis(); //get the current "time" (actually the number of milliseconds since the program started)
for(shift_RGB_couple=0;shift_RGB_couple<3;shift_RGB_couple++){
for(colorStep=0;colorStep<256;colorStep++){
int m = 255-colorStep;
int n = colorStep;
int p = 0;
if(shift_RGB_couple==0){
r=m;
g=n;
b=p;
}
if(shift_RGB_couple==1){
r=p;
g=m;
b=n;
}
if(shift_RGB_couple==2){
r=n;
g=p;
b=m;
}
for(int x = 0; x < NUM_LEDS; x++){
leds[x] = CRGB(r,g,b);
}
leds*.setRGB( r, g, b);*