even with all the delay is erased and the Blynk Virtual write is placed under the void of USMe and USNo but still, no output on the blynk apps and my LED is not working/blinking without the delay
#define BLYNK_PRINT Serial1
#include <BlynkSimpleStream.h>
BlynkTimer timer;
char auth[] = "cabb6d95d9804956b25f9e4553fc10b8";
int GreenMe =4 ;
int YellowMe =3 ;
int RedMe =2 ;
int EchoMe =22 ;
int TrigMe =23 ;
float pingUS1 ;
float targetDUS1;
String GarbageCaps1me="The Garbage Capacity for Metal is 0%";
String GarbageCaps2me="The Garbage Capacity for Metal is 50%";
String GarbageCaps3me="The Garbage Capacity is for Metal 100%";
int GreenNo =10;
int YellowNo =9;
int RedNo =8;
int EchoNo =26;
int TrigNo =27;
float pingUS2;
float targetDUS2;
String GarbageCaps1no="The Garbage Capacity for Non-Metal is 0%";
String GarbageCaps2no="The Garbage Capacity is Non-Metal 50%";
String GarbageCaps3no="The Garbage Capacity is Non-Metal 100%";
float speedOfSound=776.5;
String GarbageLCD="Garbage Capacity";
void setup()
{
Serial.begin(9600);
Serial1.begin(9600);
Blynk.begin(Serial, auth);
pinMode(EchoMe, INPUT);
pinMode(TrigMe, OUTPUT);
pinMode(EchoNo, INPUT);
pinMode(TrigNo, OUTPUT);
timer.setInterval(1000L, USMe);
timer.setInterval(1000L, USNo);
}
void USMe()
{
digitalWrite(TrigMe, LOW);
delayMicroseconds(100);
digitalWrite(TrigMe, HIGH);
delayMicroseconds(20);
digitalWrite(TrigMe, LOW);
pingUS1 = pulseIn(EchoMe, HIGH);
pingUS1 = pingUS1/1000000;
pingUS1 = pingUS1/3600;
targetDUS1 = speedOfSound*pingUS1;
targetDUS1 = targetDUS1/2;
targetDUS1 = targetDUS1*63360;
targetDUS1 = targetDUS1*2.54;
Serial.print("The distance to the trash is: ");
Serial.print(targetDUS1);
Serial.println(" centimeters");
Blynk.virtualWrite(V10, targetDUS1);
if (targetDUS1 < 10)
{
Serial.println(GarbageCaps3me);
analogWrite(RedMe, 250);
analogWrite(RedMe, 0);
}
if (targetDUS1 >= 11 && targetDUS1 <= 20)
{
Serial.println(GarbageCaps2me);
analogWrite(YellowMe, 250);
analogWrite(YellowMe, 0);
}
if (targetDUS1 >20)
{
Serial.print(GarbageCaps1me);
analogWrite(GreenMe, 250);
analogWrite(GreenMe, 0);
}
}
void USNo()
{
digitalWrite(TrigNo, LOW);
delayMicroseconds(100);
digitalWrite(TrigNo, HIGH);
delayMicroseconds(20);
digitalWrite(TrigNo, LOW);
pingUS2 = pulseIn(EchoNo, HIGH);
pingUS2 = pingUS2/1000000;
pingUS2 = pingUS2/3600;
targetDUS2 = speedOfSound*pingUS2;
targetDUS2 = targetDUS2/2;
targetDUS2 = targetDUS2*63360;
targetDUS2 = targetDUS2*2.54;
Serial.print("The distance to the trash is: ");
Serial.print(targetDUS2);
Serial.println(" centimeters");
Blynk.virtualWrite(V12, targetDUS2);
if (targetDUS2 < 10)
{
Serial.println(GarbageCaps3no);
analogWrite(RedNo, 250);
analogWrite(RedNo, 0);
}
if (targetDUS2 >= 11 && targetDUS2 <= 20)
{
Serial.println(GarbageCaps2no);
analogWrite(YellowNo, 250);
analogWrite(YellowNo, 0);
}
if (targetDUS2 >20)
{
Serial.print(GarbageCaps1no);
analogWrite(GreenNo, 250);
analogWrite(GreenNo, 0);
}
}
void loop()
{
Blynk.run();
timer.run();
}