#include "Ledpixel.h" bool st_refresh = true; #include #include "FastLED_RGBW.h" CRGBW strip1[NUM_LEDS]; // FastLED with RGBW CRGB *strip1B = (CRGB *) &strip1[0]; CRGBW strip2[NUM_LEDS]; // FastLED with RGBW CRGB *strip2B = (CRGB *) &strip2[0]; CRGBW strip3[NUM_LEDS]; // FastLED with RGBW CRGB *strip3B = (CRGB *) &strip3[0]; CRGBW strip4[NUM_LEDS]; // FastLED with RGBW CRGB *strip4B = (CRGB *) &strip4[0]; void Ledpixel::begin() { FastLED.addLeds(strip1B, getRGBWsize(NUM_LEDS)); FastLED.addLeds(strip2B, getRGBWsize(NUM_LEDS)); FastLED.addLeds(strip3B, getRGBWsize(NUM_LEDS)); FastLED.addLeds(strip4B, getRGBWsize(NUM_LEDS)); for(int i=35; i>=0; i--) { strip1[i] = CRGBW(0,0,0,0); strip2[i] = CRGBW(0,0,0,0); strip3[i] = CRGBW(0,0,0,0); } strip4[0] = CRGBW(255,0,0,0); FastLED.show(); } void Ledpixel::refresh() { FastLED.show(); } void Ledpixel::demo_leds() { for(uint16_t i=0; i=(36-led_number); i--) st_strip( i, 1, 0, 0, 0); } else if (led_number<=72) { for(int i=35; i>=(72-led_number); i--) st_strip( i, 0, 1, 0, 0); } else if (led_number<=108) { for(int i=35; i>=(108-led_number); i--) st_strip( i, 0, 0, 1, 0); } else if (led_number<=144) { for(int i=35; i>=(144-led_number); i--) st_strip( i, 0, 0, 0, 1); } else if (led_number<=180) { for(int i=35; i>=(180-led_number); i--) st_strip( i, 1, 1, 0, 0); } else if (led_number<=216) { for(int i=35; i>=(216-led_number); i--) st_strip( i, 0, 1, 1, 0); } else if (led_number<=252) { for(int i=35; i>=(252-led_number); i--) st_strip( i, 1, 0, 1, 0); } } int led_intensity_ant=0; void Ledpixel::mode2(int led_intensity) { if (abs(led_intensity_ant-led_intensity)<50) { led_intensity_ant=led_intensity; for(int i=0; i20)&& st_refresh) { refresh(); time_refresh_led = millis(); st_refresh = false; } }