Time out error while connecting to blynk server

Before creating the topic

  1. Search forum for similar topics
  2. Check http://docs.blynk.cc and http://help.blynk.cc/
  3. Add details :
    • Hardware model + communication type. For example: Arduino UNO with Ethernet Shield
    • Smartphone OS (iOS or Android) + version
    • Blynk server or local server
    • Blynk Library version
    • Add your sketch code. :point_up:Code should be formatted as example below.

Simply paste your code between ``` If you don’t format your code, your topic can be deleted by moderators.




#define BLYNK_PRINT SwSerial
#include <SoftwareSerial.h>
SoftwareSerial SwSerial(10, 11); // RX, TX
#include <BlynkSimpleStream.h>
char auth[] = "ME1xinkvEoF2Pp8ekkdlU0yCrfg1DxDm";


WidgetLCD lcd(V1);
long duration, distance;
int trig =4;
int eco =5;

BlynkTimer timer;
void myTimerEvent()
{
  int data = analogRead(A2)*(3.20/1023.0)*100.0;
  Blynk.virtualWrite(V5, data);
}

BLYNK_WRITE(V2)
{
  int pinValue = param.asInt();
  digitalWrite(2, pinValue);
  digitalWrite(3, pinValue);
}

void setup()
{
  SwSerial.begin(9600);
  Serial.begin(9600);
  Blynk.begin(Serial, auth);
  timer.setInterval(1000L, myTimerEvent);

  pinMode(trig, OUTPUT);
  pinMode(eco, INPUT);
  lcd.clear();
  lcd.print(0, 0, "distance CM");
}

void loop()
{
  lcd.clear();
  lcd.print(0, 0, "distance CM");
  
  digitalWrite(trig, LOW);
  delayMicroseconds(3);
  digitalWrite(trig, HIGH);
  delayMicroseconds(10);
  digitalWrite(trig,LOW);

  duration = pulseIn(eco, HIGH);
  distance = (duration/2) /588.10;
  lcd.print(7,1, distance);
  
  Blynk.run();
  timer.run(); // Initiates BlynkTimer
  delay(1000);
}

Clean the void loop , you can’t use any delay or blocking function with Blynk :stuck_out_tongue_winking_eye:

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

Still Not working :frowning:

It would be helpful if provided this information!

Pete.

actullay im doing this on proteus software