BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

[SOLVED] LCD example doesn't work

I tried to run the LCD example sketch but was unable to produce the expected result. I installed Blynk 0.3.3, and updated the app. I am using an Android, connected to an Ethermega with ethernet to the router. I confirmed network connections by toggling relays that I have connected to the Ethermega, and also passing DHT22 values to value display widgets. I have absolutely no idea how to proceed. The only modification I’ve made to the code is adding my auth key.

#define BLYNK_PRINT Serial
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "myAuthKey";

WidgetLCD lcd(V1);

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth);

  while (Blynk.connect() == false) {
    // Wait until connected
  }

  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");
  // Please use timed events when LCD printintg in void loop to avoid sending too many commands
  // It will cause a FLOOD Error, and connection will be dropped
}

void loop()
{
  Blynk.run();
}


Any ideas?

Can you please share your LCD widget setup?

Sorry for the volume display, screenshots aren’t my strong suit!

My LCDs were working but after the update they aren’t anymore

1 Like

@myggle you need to switch to ADVANCED mode. This sketch is for advanced mode.

1 Like

@nolmath Could you please try to explain us what is your setup it may help to resolve issue.

Dmitry, I tried to list everything I have with my opening post. Can you point out what I else I need to include? TYIA!

Edit - I just tried advanced mode and Hello World displayed as it was meant to. I consider this problem resolved. Thank you for getting me on track!

I just opened LCD example - it is really bad. We need to think how it could be improved.

@myggle just made few changes to sketches. Please have a look https://github.com/blynkkk/blynk-library/tree/master/examples/Widgets/LCD

Also - don’t forget to read comments in sketch :wink:

1 Like

Just ran the simple mode sketch. Works as expected. The added comments are very helpful in getting it configured properly the first time. Thanks for the changes made!!!

1 Like

I am using the advance mode. I have sensors hooked up and if they are high it displays one text and if it’s low it displays another text. I have a refresh button to make it update. It’s not running on a timer or anything. It was working great until I updated. I also shared this project with my family if that makes a difference

I suppose you have iOS?

Yes. I have iOS. I haven’t changed the code or the hardware in over a month

Bug for latest iOS version confirmed. Will be fixed in next release. Sorry for inconveniences.

2 Likes

@Dmitriy Will this be fixed in the next update or the one that just came out for iOS because I just updated and it still doesn’t work :sob:

@nolmath yes, those one (in store) was published 2 weeks ago, before you found a bug :slight_smile:

@Dmitriy Should the bug be fixed after this update that just came out for iOS? My LCDs still aren’t working like they used to

@nolmath not sure. @ashvetsov could you please tell?

Dear @nolmath.

I checked LCD widget advanced mode on my side and it work just fine.
Are you sure you send values to pins in advanced mode properly?
Please check this sketch example - hope it will be useful for you.

 #include <SoftwareSerial.h>
 SoftwareSerial SwSerial(2, 3); // RX, TX
 #define BLYNK_PRINT SwSerial
 #include <BlynkSimpleSerial.h>
 #include <SimpleTimer.h>
 
 // You should get Auth Token in the Blynk App.
 // Go to the Project Settings (nut icon).
 char auth[] = "your token";

 SimpleTimer timer;

 int v1Value = 0;
 int v2Value = 0;
 float v4Value = 0;   
   
 void sendUptime()
 {
   Blynk.virtualWrite(V4, "clr");
   Blynk.virtualWrite(V4, "p", v1Value, v2Value, v4Value);

   v1Value ++;
   v2Value ++;
   v4Value ++;

   if (v1Value > 15) {
     v1Value = 0;
   }
   if (v2Value > 1) {
     v2Value = 0;
   }
   if (v4Value > 1024) {
     v4Value = 0;
   }
 }

 void setup()
 {
   SwSerial.begin(9600);
   Blynk.begin(auth);
   timer.setInterval(100L, sendUptime);
 }
 
void loop()
 {
   Blynk.run();
   timer.run();
 }

@BlynkiOSDev your sample sketch for advanced mode of LCD is quite different to the one Blynk has on github at https://github.com/blynkkk/blynk-library/blob/master/examples/Widgets/LCD/LCD_AdvancedMode/LCD_AdvancedMode.ino

Does lcd.clear() still function as it has always done or do we need to be doing a virtualWrite to the pin with “clr” as in your example? Same question for writing values to the LCD (lcd.print(4, 0, String or variable) versus virtualWrite(virtualpin, value)?

Maybe either method can be used?