I need to stop, start and reset the time with Blynk

Hi guys,
time stops but time keeps flowing

My Code:
[Unformatted code removed by moderator]

my codes are missing, I am waiting for your help.Thank you :slight_smile:

Your code is missing triple backticks at the beginning and end. Without these the code doesn’t display correctly.
Please use the pencil icon at the bottom of your post to edit your post and add triple backticks at the beginning and end of your code.
Triple backticks look like this:
```

Also, I’d recommend post your entire sketch, and provide details of which virtual pins your widgets are attached to, and which widget(s) are causing the problem.

Pete.

Sorry, i have code knowledge but i don’t know how to add code with arduino

[Unformatted code removed by moderator]

There no point in keep posting code without triple backticks at the beginning and end. The code will just keep being deleted and eventually your community account will be suspended.

Pete.

Sorry,ı can not see triple backticks

I’ve given you some to copy and paste in post #2

Pete,

#define BLYNK_PRINT Serial

#include <ESP8266WiFi.h> 
#include <BlynkSimpleEsp8266.h>
#define sensor A0 
#include <SimpleTimer.h>


BlynkTimer timer;

//------------------------------//

#define M_PI   3.14159265358979323846 /* pi */

//-------------1.KISIM--------------------//
//Q=VA;
//Q=HACİMSEL DEBİ(METRE^2/SANİYE);
//V=ÇİZGİSEL HIZ(METRE/SANİYE);
//A=ALAN(METRE^2);
//D=KULLANACAĞIMIZ HORTUMUN ÇAPI;
// 1 LİTRE=0.001 METREKÜP;
// 1 METREKÜP=1000 LİTRE;
// 1 LİTRE 43 SANİYEDE BOŞALTILIYOR;
// Q=1/(1000*SANİYE);
//-------------------------------------//
float  pi=M_PI;
float D=0.035;
float A=pi*D*D/4;
double LITRE=1;
float SANIYE=43;
float Q=LITRE/(1000*SANIYE);
float V=Q/A;
//-------------2.KISIM--------------------//

//V=4Q(Pİ*ÇAP*ÇAP);
//M=PVA;
//P=YOĞUNLUK;
//M=KÜTLESEL DEBİ;
//Sıcaklık değeri değiştiğinden,suyun derecesi 10 olarak alınmıştır.

//-------------------------------------//

float P= 999.75;
float M=P*V*A;

//------------------------------//


char token[] = "OYGM7VsofCLYlmsK10Qud9N90EXalPAA";
char agAdi[] = "FiberHGW_TP8C18_2.4GHz"; //Blynk uygulamasının bize vermiş olduğu token ve bağlanmak istediğimiz wifi ve şifresini char komutu ile belirliyoruz.
char agSifre[] = "MjtPvVyH";
int deger ;      // okuma yapacağımız nem değerini deger değişkeni olarak belirliyoruz.
int donusum;
float donusum2=0;
float donusum3=0;
int i=2;
float toplamLitre=23.2558;

void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V4, (millis() / 1000));
}

void setup() {
  // put your setup code here, to run once:

  Serial.begin(9600);   //Blynk ve ESP iletişimi için serial monitörü başlatıyoruz.
  
  Blynk.begin(token, agAdi, agSifre);  // blynk uygulaması ve ESP bağlantısı sağlanması açısından Blynk.begin komutu içerisine token ve ag adı,şifremizi yazıyoruz.

  
}


int kaydet=timer.setInterval(1000L, myTimerEvent);

BLYNK_WRITE(V0){
   int timerResponse = param.asInt();
 
    if (timerResponse == 1){
      timer.enable(kaydet); // Turn on    
            Serial.println("Timer Started");
       
         /* donusum2=toplamLitre+donusum2;
            donusum3=M+donusum3;
            Blynk.virtualWrite(V3,donusum2 ," Litre");
            Blynk.virtualWrite(V5,donusum3, " kg/s");*/
        
         
    }
   else{
           timer.disable(kaydet); //  off      
           Serial.println("Timer Stopped");
   }
}
long previousMillis = 0;        // will store last time LED was updated
 
// the follow variables is a long because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long interval = 1000;    

void loop() {
  // put your main code here, to run repeatedly:
  // 1 SANİYE=1000 MİLİS;
  // 1 LİTRE=1000 MİLİLİTREDİR;
  // 1000 MİLİLİTRE 43 SANİYEDE DOLUYOR;
  //1 SANİYEDE 23.2558 MİLİLİTRE DOLUYOR;

     
   Blynk.virtualWrite(V2,M, " kg/s");
   deger = analogRead(sensor);    //toprak nem sensöründen analog okuma yapıyoruz.
   donusum=map(deger ,0,1023,0,100);     // okunan bu değer 0-1023 değeri arasında olacağı için burada map komutu ile istediğimiz 0-100 aralığına çeviriyoruz.
   Blynk.virtualWrite (V1, donusum);

}

The very first thing you need to do is to remove everything from your void loop, and replace it with Blynk.run and timer.run commands.

Read this:

Pete.

yes, thank you but ı mean, i want to add start, stop and reset command.For example, the counter will stop when I press the stop button, it will reset when I press the reset button

Sort out your code structure first, then post your updated code and full details of what does and doesn’t work.

Pete.