I'm working on a blynk project with Arduino Uno,I used esp 01 to connect the Arduino to internet.
I want to display the results on lcd with I2c but it doesn't work for some reason , I tested ESP 01 alone and it's working just fine in controlling a led.
This is the code
// Template ID, Device Name and Auth Token are provided by the Blynk.Cloud
// See the Device Info tab, or Template settings
#define BLYNK_TEMPLATE_ID "TEMPLATE_ID "
#define BLYNK_DEVICE_NAME "DEVICE_NAME "
#define BLYNK_AUTH_TOKEN "AUTH_TOKEN "
// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
char auth[] = BLYNK_AUTH_TOKEN;
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "network_ssid";
char pass[] = "password";
// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1
char dat[] = "to confirm";
// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Your ESP8266 baud rate:
#define ESP8266_BAUD 38400
ESP8266 wifi(&EspSerial);
BlynkTimer timer;
// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void myTimerEvent()
{
// You can send any value at any time.
// Please don't send more that 10 values per second.
Blynk.virtualWrite(V5, dat);//millis() / 1000
Blynk.virtualWrite(V0, 58.9);
}
void setup()
{
// Debug console
Serial.begin(115200);
LiquidCrystal_I2C lcd(0x26, 16, 2);
lcd.begin();
lcd.backlight();
lcd.clear();
// Set ESP8266 baud rate
EspSerial.begin(ESP8266_BAUD);
delay(10);
Blynk.begin(auth, wifi, ssid, pass);
// Setup a function to be called every second
timer.setInterval(1000L, myTimerEvent);
}
void loop()
{
Blynk.run();
timer.run(); // Initiates BlynkTimer
}
so Blynk works ans you want display a value on an I2C LCD.
so maybe forget Blynk for a short time and start with an example of the LiquidCrystal library
That's no the way to run I2C on an UNO. Wrong connection pins. Usually SCL and SCK are found on the board left of pin "Aref", upper left in Your painting.
Those pins are also connected to A4 and A5.
Please update Your post to show the situation You are asking about.
Schematics, links to datasheet are preferred. Sadly Flow Charts is something learned from courses but unknown by members using word sallad.
W s way to often goes like this causing lots of posting to clarify the first post. This is bad use of helpers time.
I tried ESP alone without LCD and i get the desired results , and the same goes for LCD alone without ESP and it's working correctly.
The problem is when combined both LCD and ESP the LCD prints out just the first print order , And the ESP stay connected to blynk server for seconds (in blynk app shows that your device is **offline** ).
I couldn't find out the reason for this conflict, I tried to find which command the conflict starting with , so I deleted every command required for LCD to work then added them one by one ,turns out it's the command to declare the address for LCD .
For Your little setup the pic is good enough but for larger projects, it would be a useless coloured bird nest.
Nothing wrong in the connections shown but how do You power the UNO? That could be an issue if it's not proper.