Buenos dias
Tengo un Attiny 85 con 512 Bytes de memoria ram quiero controlar 160 led WS2812b con la libreria Fastled, con la memoria que tengo solo me da para controlar 100 led , me gustaria que me echarais una mano con el codigo pues lo que queria hacer es utilizar PROGMEM con el objetivo de liberar la memoria flash y liberar un poco la SRAM; mis conocimientos de programacion son un poco limitados. Muchas gracias de antemano. Aqui esta el codigo.
#include <FastLED.h>
#define LED_PIN 0
//#define CLOCK_PIN 4
#define NUM_LEDS 100
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
#define BRIGHTNESS 200
CRGB leds[NUM_LEDS];
void setup() {
delay(1000);
LEDS.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS);
// LEDS.addLeds<LED_TYPE, LED_PIN, CLOCK_PIN COLOR_ORDER>(leds, NUM_LEDS);
FastLED.setBrightness(BRIGHTNESS);
}
void loop() {
FastLED.clear();
fill_solid(leds, NUM_LEDS, CRGB(255,0,0));
FastLED.show();
delay(2000);
FastLED.clear();
fill_solid(leds, NUM_LEDS, CRGB(0,255,0));
FastLED.show();
delay(2000);
FastLED.clear();
fill_solid(leds, NUM_LEDS, CRGB(0,0,255));
FastLED.show();
delay(2000);
FastLED.clear();
for(int i=0;i<NUM_LEDS;i++){
leds[i].setRGB(255,0,0);
FastLED.show();
delay(20);
}
FastLED.clear();
for(int i=0;i<NUM_LEDS;i++){
leds[i].setRGB(0,255,0);
FastLED.show();
delay(20);
}
FastLED.clear();
for(int i=0;i<NUM_LEDS;i++){
leds[i].setRGB(0,0,255);
FastLED.show();
delay(20);
}
FastLED.clear();
for(int i=0;i<NUM_LEDS;i++){
fill_rainbow(leds,i, 0, 5);
FastLED.show();
delay(20);
}
FastLED.clear();
for(int i=0;i<NUM_LEDS;i++){
leds[i-3].setRGB(0,0,0);
leds[i].setRGB(255,0,0);
FastLED.show();
delay(20);
}
FastLED.clear();
for(int i=0;i<NUM_LEDS;i++){
leds[i-3].setRGB(0,0,0);
leds[i].setRGB(0,255,0);
FastLED.show();
delay(20);
}
FastLED.clear();
for(int i=0;i<NUM_LEDS;i++){
leds[i-3].setRGB(0,0,0);
leds[i].setRGB(0,0,255);
FastLED.show();
delay(20);
}
FastLED.clear();
for(int i=0;i<NUM_LEDS;i++){
leds[i-3].setRGB(255,0,0);
leds[i].setRGB(255,255,255);
FastLED.show();
delay(20);
}
FastLED.clear();
for(int i=0;i<NUM_LEDS;i++){
leds[i-3].setRGB(0,255,0);
leds[i].setRGB(255,255,255);
FastLED.show();
delay(20);
}
for(int i=0;i<NUM_LEDS;i++){
leds[i-3].setRGB(0,0,255);
leds[i].setRGB(255,255,255);
FastLED.show();
delay(20);
}
for(int i = 0; i < NUM_LEDS; i++) {
leds[i-3].setRGB(125,0,125);
leds[i].setRGB(255,255,255);
FastLED.show();
delay(20);
}
FastLED.clear();
} // loop