Multiple LCD Widgets at the same Blynk project

Hello everyone,

Looking for a code to show more than one LCD widget at the same time. Actually I need 3 LCD widgets for three sensors to show 3 separate information. Is there any idea how to do that please

Do you mean Blynk LCD widgets, or physical LCDs?

Pete.

Yes sorry I mean widgets

Okay, well I think that LCD widgets aren’t actually a very good solution for this, as they are quite bulky and ugly, and I prefer to use labelled value widgets instead, but if you’re wedded to LCDs then the solution is quite simple…

The demo code here:

defines a single LCD widget object called lcd

WidgetLCD lcd(V1);

then writes to it like this:

  lcd.clear(); //Use it to clear the LCD Widget
  lcd.print(4, 0, "Hello"); // use: (position X: 0-15, position Y: 0-1, "Message you want to print")
  lcd.print(4, 1, "World");

You need to define three LCD widget objects, with different names. You could do this:

WidgetLCD lcd_1(V1);
WidgetLCD lcd_2(V2);
WidgetLCD lcd_3(V3);

and write to them like this…

  lcd_1.clear();
  lcd_1.print(4, 0, "This is");
  lcd_1.print(4, 1, "LCD 1");

  lcd_2.clear();
  lcd_2.print(4, 0, "This is");
  lcd_2.print(4, 1, "LCD 2");

  lcd_3.clear();
  lcd_3.print(4, 0, "This is");
  lcd_3.print(4, 1, "LCD 3");

or you could give your LCD widget objects more meaningful names like…

WidgetLCD Temperature_LCD1(V1);
WidgetLCD Humidity_LCD(V2);
WidgetLCD Pressure_LCD(V3);

and use these names when you want to print data to them.

Pete.

Thank you so much Pete for your nice and clear explanation
Abdul

1 Like