LCD Widget: Black background please

I’d love to be able to have white text on a black background for the LCD widget.

1 Like

Sooo… Change it :wink:

Blynk.setProperty(Vx, "color", #000000); // Change color of Vx Widget (i.e. LCD) to BLACK

As per…

http://docs.blynk.cc/#blynk-firmware-virtual-pins-control-blynksetpropertyvpin-property-value

Don’t forget to set text color to white, in the app.

@Gunner I thought about that too but I’m not sure if setProperty has 2 “color” options i.e the widget background and the text. Have you tried it?

@Costas I have it flashing all the colours from the zeRGBa (thanks to your assist on that code :wink:) while displaying the actual HEX value of said colour. Text is ether Black or White, so only “vanishes” when same background.

BLYNK_WRITE(V2)  // zeRGBa Widget Function
{
  Blynk.run();
  int r = param[0].asInt(); // get a RED channel value.
  int g = param[1].asInt(); // get a GREEN channel value.
  int b = param[2].asInt(); // get a BLUE channel value.
  //analogWrite(RedP, r);  // Optional - Write to RED RGB pin.
  //analogWrite(GrnP, g);  // Optional - Write to GREEN RGB pin.
  //analogWrite(BluP, b);  // Optional - Write to BLUE RGB pin.
  String strRED = String(r, HEX);  // Convert RED DEC to HEX.
  if (r < 16) {
    strRED = String("0" + strRED);  // Buffer with 0 if required.
  }
  String strGRN = String(g, HEX);  // Convert GREEN DEC to HEX.
  if (g < 16)  {
    strGRN = String("0" + strGRN);  // Buffer with 0 if required.
  }
  String strBLU = String(b, HEX);  // Convert BLUE DEC to HEX.
  if (b < 16)  {
    strBLU = String("0" + strBLU);  // Buffer with 0 if required.
  }
  String HEXstring = String("#" + strRED + strGRN + strBLU);  // Combine HEX fragments.
  HEXstring.toUpperCase();  // Change HEX value to all upper case for ease of visuals.
  Blynk.setProperty(V3, "color", HEXstring);  // Send formatted HEX colour to vLCD Display.
  lcd.clear();
  lcd.print(0, 0, "Color HEX Value:");
  lcd.print(4, 1, HEXstring);
}

I know how to do the code but I’m not convinced the LCD has background and text color options from setProperty.

The code was more for others… You do not need code from mere mortals like me :slight_smile:

With BLACK text

Oops, now not visible :wink:

1 Like

I guess I was right, you can’t change the text color when the project is running but that’s not important as long as you have set it to the desired white before you start. Then the one color attribute of background can be changed whilst the project is running, as per your screenshots.

Can we have a black background screenshot please :slight_smile:

I think changing the text colour with Blynk.setProperty() would be a nice addition to features. DISCO LCD :smile:

1 Like

I was hoping to see white text on the black background.

My personal preference is the traditional blue background with black text which is available as a default but I can see that some Blynkers might like a traditional white on black.

Ah, sorry… thought you were joking :stuck_out_tongue:

I even tried Blynk.setProperty(V3, "label", HEXstring);… just in case… but that secret Chinese facility has got their marketing locked down :wink:

1 Like