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();
}
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!!!
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 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();
}
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)?