FastLED color change

Hi all, I have a problem creating a static font display without scrolling.
After searching, I found some examples.
but there is a problem how to change the font color.
is it possible to change the color without adding a new frame?
Thank you.

#include <avr/pgmspace.h>  
#include "Arduino.h"
#include <FastLED.h>
#include <EEPROM.h>

#define LED_PIN    3  
#define NUM_LEDS    256
#define BRIGHTNESS 30
CRGB leds[NUM_LEDS];


Int timer = 1000;


const long text_green[] PROGMEM = {   //FRAME1 TEXT WITH GREEN COLOR
0x00000000, 0x0000FF00, 0x0000FF00, 0x00000000, 0x0000FF00, 0x00000000, 0x00000000, 0x0000FF00, 0x00000000, 0x0000FF00, 0x00000000, 0x0000FF00,
0x0000FF00, 0x0000FF00, 0x0000FF00, 0x00000000, 0x00000000, 0x0000FF00, 0x0000FF00, 0x00000000, 0x00000000, 0x0000FF00, 0x00000000, 0x0000FF00,
0x0000FF00, 0x00000000, 0x0000FF00, 0x00000000, 0x00000000, 0x0000FF00, 0x0000FF00, 0x00000000, 0x00000000, 0x0000FF00, 0x00000000, 0x0000FF00,
0x00000000, 0x0000FF00, 0x00000000, 0x00000000, 0x0000FF00, 0x00000000, 0x00000000, 0x0000FF00, 0x00000000, 0x0000FF00, 0x0000FF00, 0x00000000,

};

/*
const long text_blue[] PROGMEM = { //FRAME2 
}
*/

void setup() 
{
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
FastLED.setBrightness(BRIGHTNESS);
}

void loop(){

FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++)  {
  leds[i] = pgm_read_dword(&(text_green[i]));  
FastLED.show();
delay(timer); 
}
}

really?

yes. lay colored foil on the LEDs

I'm just learning coding, what should I do?

read about types of variables

Should be
FastLED.delay(timer);
to give the library time to update what´s needed.

If you want to change a specific color (0x0000FF00) from your "green Text", you could remove "const" and "PROGMEM". This will need more ram, but you are able to loop through the array and replace the color with another one.

Thank you for reply.
This my solution
I change array.

int array[5] = { 6,8,12,16,18 };
uint8_t sizearray = sizeof(array)/sizeof(array[0]);

for (uint8_t i=0; i<sizearray; i++) {
leds[ array[i] ] = CHSV(hue,255.255);
}
EVERY_N_MILLISECOND(10){
hue++};

No need 3D eyeglasses for change color :smiley:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.