Can't set initial state for sliders and an RGBW LED strip

Hello Blynkers! My project uses a WeMos D1 Mini connected to four MOSFETs; each of which drives one channel of a Red/Green/Blue/White LED strip.

In the Blynk app, I have sliders attached to virtual pins (V1…V4). I also have two buttons acting as switches (V5 and V6) to turn on a preset color combination, or turn off all of the LEDs.

All of the above, works well! I can use the sliders to set the LEDs to any level of brightness, and the two preset buttons work correctly; setting each channel to the color level set my code.

I have code in the setup section that sets the initial values of the color channels; as follows:

  Serial.println("Default state: Red Lights - On, 75%");
  analogWrite(ledRed, 768);    // Set the LED colors
  analogWrite(ledGreen, 0);
  analogWrite(ledBlue, 0);
  analogWrite(ledWhite, 0);
  Blynk.virtualWrite(V1, 768);  // Send initial value to app.
  Blynk.virtualWrite(V2, 0);
  Blynk.virtualWrite(V3,0);
  Blynk.virtualWrite(V4,0);

The problem is that these initial settings never take effect. When I first start the D1 Mini, the red, green, and blue channels are partially on, and the white channel is off. On my phone, the app and the sliders show values of zero for all channels.

I’ve read numerous articles here and elsewhere, and experimented with BLYNK_READ, Sync, and other possible fixes, but I’m stumped. If anyone knows how to set the initial state of the LEDs, and the sliders, I would welcome your input.

– ENVIRONMENT –
Hardware: WeMos D1 Mini, V2.1
Arduino IDE: 1.6.13
Blynk Library: 0.4.4
Blynk App, iPhone: 2.8.5
iOS: 9.3.5
Other software: Tzapu Wifi Manager

Roo-ster

Study the docs in detail for sync.