Fix analog write range

This commit is contained in:
cschwinne 2019-12-30 17:34:15 +01:00
parent 92b532ce9a
commit 6e35b5ba8b
4 changed files with 20 additions and 21 deletions

View File

@ -242,7 +242,7 @@ uint16_t WS2812FX::mode_dynamic(void) {
uint32_t cycleTime = 50 + (255 - SEGMENT.speed)*15; uint32_t cycleTime = 50 + (255 - SEGMENT.speed)*15;
uint32_t it = now / cycleTime; uint32_t it = now / cycleTime;
if (it != SEGENV.step) //new color if (it != SEGENV.step && SEGMENT.speed != 0) //new color
{ {
for(uint16_t i=SEGMENT.start; i < SEGMENT.stop; i++) { for(uint16_t i=SEGMENT.start; i < SEGMENT.stop; i++) {
if (random8() <= SEGMENT.intensity) _locked[i] = random8(); if (random8() <= SEGMENT.intensity) _locked[i] = random8();

View File

@ -130,26 +130,25 @@ public:
_pGrbw = new NeoPixelBrightnessBus<PIXELFEATURE4,PIXELMETHOD>(countPixels, LEDPIN); _pGrbw = new NeoPixelBrightnessBus<PIXELFEATURE4,PIXELMETHOD>(countPixels, LEDPIN);
#endif #endif
_pGrbw->Begin(); _pGrbw->Begin();
break;
#ifdef WLED_USE_ANALOG_LEDS
#ifdef WLED_USE_ANALOG_LEDS pinMode(WPIN, OUTPUT);
//init PWM pins - PINs 5,12,13,15 are used with Magic Home LED Controller #ifdef WLED_USE_5CH_LEDS
pinMode(RPIN, OUTPUT); pinMode(W2PIN, OUTPUT);
pinMode(GPIN, OUTPUT);
pinMode(BPIN, OUTPUT);
switch (_type) {
case NeoPixelType_Grb: break;
#ifdef WLED_USE_5CH_LEDS
case NeoPixelType_Grbw: pinMode(WPIN, OUTPUT); pinMode(W2PIN, OUTPUT); break;
#else
case NeoPixelType_Grbw: pinMode(WPIN, OUTPUT); break;
#endif
}
analogWriteRange(255); //same range as one RGB channel
analogWriteFreq(880); //PWM frequency proven as good for LEDs
#endif #endif
#endif
break;
} }
#ifdef WLED_USE_ANALOG_LEDS
//init PWM pins - PINs 5,12,13,15 are used with Magic Home LED Controller
pinMode(RPIN, OUTPUT);
pinMode(GPIN, OUTPUT);
pinMode(BPIN, OUTPUT);
analogWriteRange(255); //same range as one RGB channel
analogWriteFreq(880); //PWM frequency proven as good for LEDs
#endif
} }
#ifdef WLED_USE_ANALOG_LEDS #ifdef WLED_USE_ANALOG_LEDS

View File

@ -98,7 +98,7 @@
//version code in format yymmddb (b = daily build) //version code in format yymmddb (b = daily build)
#define VERSION 1912232 #define VERSION 1912291
char versionString[] = "0.9.0-b2"; char versionString[] = "0.9.0-b2";

View File

@ -243,7 +243,7 @@ void serializeInfo(JsonObject root)
leds_pin.add(LEDPIN); leds_pin.add(LEDPIN);
leds["pwr"] = strip.currentMilliamps; leds["pwr"] = strip.currentMilliamps;
leds["maxpwr"] = strip.ablMilliampsMax; leds["maxpwr"] = (strip.currentMilliamps)? strip.ablMilliampsMax : 0;
leds["maxseg"] = strip.getMaxSegments(); leds["maxseg"] = strip.getMaxSegments();
leds["seglock"] = false; //will be used in the future to prevent modifications to segment config leds["seglock"] = false; //will be used in the future to prevent modifications to segment config