library updates

* FastLED 3.5.0 #master (up to 50% faster)
* All ESP32 env use NeoPixelBus 2.7.3 (slightly faster)
* Weather usermod: small update, as fastLED wants an explicit conversion from CRGB -> uint32_t
* weather usermod: avoid using palette color #0 = black
This commit is contained in:
Frank
2023-05-07 21:15:31 +02:00
parent 9a4c020630
commit 50b3c9dc62
3 changed files with 20 additions and 21 deletions

View File

@@ -35,7 +35,7 @@ uint16_t mode_2DWeather(void) {
// currentTime = localTime;
}
else
color = ColorFromPalette(SEGPALETTE, map((uint8_t)weather_temps[x%100], 0, 40, 0, 255), 255, LINEARBLEND);
color = ColorFromPalette(SEGPALETTE, map((uint8_t)weather_temps[x%100], 0, 40, 1, 255), 255, LINEARBLEND);
for (int y=0; y<SEGMENT.virtualHeight() * (weather_temps[x%100]-weather_minTemp)/(weather_maxTemp - weather_minTemp); y++) {
SEGMENT.setPixelColorXY(x, SEGMENT.virtualHeight() - y, color);
@@ -58,7 +58,7 @@ uint16_t mode_2DWeather(void) {
snprintf(tempString, 5, "%5.2f", currentTemp); // snprintf will prevent overflow
// Serial.println();
CRGB color = ColorFromPalette(SEGPALETTE, map((uint8_t)currentTemp, 0, 40, 0, 255), 255, LINEARBLEND);
CRGB color = ColorFromPalette(SEGPALETTE, map((uint8_t)currentTemp, 0, 40, 1, 255), 255, LINEARBLEND);
//really don't understand why this is not working if width < 16 (only works when Serial.println is uncommented ???)
// uint16_t x = 0;
// const uint16_t xSpace = (SEGMENT.virtualWidth()<16)?4:5;
@@ -78,17 +78,17 @@ uint16_t mode_2DWeather(void) {
// // Serial.printf(" %d %d\n", x, xSpace);
if (SEGMENT.virtualWidth() < 16) {
SEGMENT.drawCharacter(tempString[0], 0, -2, 5, 8, color);
SEGMENT.drawCharacter(tempString[1], 4, -2, 5, 8, color);
SEGMENT.drawCharacter(tempString[0], 0, -2, 5, 8, uint32_t(color), BLACK);
SEGMENT.drawCharacter(tempString[1], 4, -2, 5, 8, uint32_t(color), BLACK);
SEGMENT.setPixelColorXY(8, 4, color);
SEGMENT.drawCharacter(tempString[3], 9, -2, 5, 8, color);
SEGMENT.drawCharacter(tempString[3], 9, -2, 5, 8, uint32_t(color), BLACK);
}
else {
SEGMENT.drawCharacter(tempString[0], 0, -2, 5, 8, color);
SEGMENT.drawCharacter(tempString[1], 5, -2, 5, 8, color);
SEGMENT.drawCharacter(tempString[0], 0, -2, 5, 8, uint32_t(color), BLACK);
SEGMENT.drawCharacter(tempString[1], 5, -2, 5, 8, uint32_t(color), BLACK);
SEGMENT.setPixelColorXY(10, 4, color);
SEGMENT.drawCharacter(tempString[3], 12, -2, 5, 8, color);
SEGMENT.drawCharacter(tempString[4], 17, -2, 5, 8, color);
SEGMENT.drawCharacter(tempString[3], 12, -2, 5, 8, uint32_t(color), BLACK);
SEGMENT.drawCharacter(tempString[4], 17, -2, 5, 8, uint32_t(color), BLACK);
}
return FRAMETIME;