add brightness control for default color
Signed-off-by: dragonchaser <christian@boltares.de>
This commit is contained in:
@@ -36,6 +36,7 @@ void Vibrate();
|
||||
#define LED_COLOR_ORDER RGB // USE GRB for the onboard led and RGB for the chain
|
||||
|
||||
#define LED_BRIGHTNESS 96
|
||||
#define LED_BRIGHTNESS_DIMM 16
|
||||
#define LED_FRAMES_PER_SECOND 24
|
||||
#define LED_SETUP_DISPLAY_DELAY 500
|
||||
|
||||
@@ -193,8 +194,6 @@ void setup() {
|
||||
pinMode(VIBRO_PIN, OUTPUT);
|
||||
}
|
||||
|
||||
UpdatePalette();
|
||||
|
||||
FastLED.setBrightness(LED_BRIGHTNESS);
|
||||
|
||||
FastLED.addLeds<LED_TYPE,LED_DATA_PIN,LED_COLOR_ORDER>(leds, LED_NUM_LEDS).setCorrection(TypicalLEDStrip);
|
||||
@@ -212,7 +211,9 @@ void setup() {
|
||||
FastLED.delay(LED_SETUP_DISPLAY_DELAY);
|
||||
|
||||
fill_solid(leds, LED_NUM_LEDS, CRGB::Black );
|
||||
FastLED.show();
|
||||
FastLED.show();
|
||||
|
||||
UpdatePalette();
|
||||
|
||||
startindex = 0;
|
||||
updateTimer.set(UPDATE_INTERVAL, CleanDatabase);
|
||||
@@ -303,10 +304,12 @@ void UpdatePalette() {
|
||||
|
||||
if (colors.empty()) {
|
||||
fill_solid(pal.entries, LED_PALETTE_SIZE, LED_DEFAULT_COLOR_ON);
|
||||
FastLED.setBrightness(LED_BRIGHTNESS_DIMM);
|
||||
} else {
|
||||
for (int i=0; i<LED_PALETTE_SIZE; i++) {
|
||||
pal[i] = CRGB(StrToHex(colors[ i % deviceDatabase.size() ].c_str()));
|
||||
}
|
||||
FastLED.setBrightness(LED_BRIGHTNESS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user