Timer :start and stop output to control

Hello ,

I am a new user blynk.
I try to use the timer function with a start and stop output to control a defined time.
can someone help me, I look for the code.
the rest work (driving an output using a button or slider.)
thank you in advance.

Do you know where the Blynk examples are on GitHub?

Hello ,
Yes i know ,but there is not what i want .
I just want to pilot an outpout whit stop and start timer.
i don’t know how to make.
Thanks

It is a bad example for the timer widget.

for the virtual pin you have allocated, say 0, something like:

BLYNK_WRITE(V0){
  int timerResponse = param.asInt();
  if(timerResponse == 1){
    // do something
  }
  else{
    // do something different
  }
}

Re,

The problem is the same, i want to pilot the outpout “2”,i don’t understand…

BLYNK_WRITE(V0){
int timerResponse = param.asInt();
if(timerResponse == 1){
digitalWrite(2,HIGH);
}
else{
digitalWrite(2,LOW);
}

What does pilot mean?

Arduino 1.0.6 and wifi cc3000.

What does this have to do with the word “pilot”?

Can you please explain what this means as I don’t have a clue.

Is the digitalWrite sent HIGH at the start time and LOW at the stop time?

Maybe add in the IF Serial.println(“Timer started”);
and in the else Serial.println(“Timer finished”);

I realize APP and blynk’s great and easy to use.
<here is my you tube channel,you can see what i make.
https://www.youtube.com/user/azertyuiop294.

I think he wants an output with variable values, like stopping/starting with analogWrite using slider values. I’m not entirely sure that’s it, but ok. (AWESOME pretty fishtank b.t.w.!)

The timer widget can do a lot for you.

The “V0” part in BLYNK_WRITE(V0) is the indicator for the output you want to drive, in this case a virtual Pin connected to the Timer in your Blynk App.

i want an oupout just whith high or low value (digital Write or AnalogWrite) whith timer start and stop(widget) but it don’t work…

Can you please post your entire code and a screenshot of your dashboard in stopped mode? (remove auth token and Wifi info from sketch though).

#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
// These are the interrupt and control pins for СС3000
#define ADAFRUIT_CC3000_IRQ 3
#define ADAFRUIT_CC3000_VBAT 5
#define ADAFRUIT_CC3000_CS 10

#include <SPI.h>
#include <Adafruit_CC3000.h>
#include <BlynkSimpleCC3000.h>
#include <SimpleTimer.h>

//SimpleTimer timer;

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = “xxxxxxxxxxxxxx”;
//5cfca774473147c190bb947a4dcad1b3
void setup()
{
Serial.begin(115200);
Blynk.begin(auth, “code”, “pass”, WLAN_SEC_WPA2);

}

void loop()
{
Blynk.run();
//BLYNK_WRITE();
}
BLYNK_WRITE(V0){
int timerResponse = param.asInt();
Blynk.virtualWrite(V0, 1);
if(timerResponse == 1){
digitalWrite(2,HIGH);
}
else{

digitalWrite(2,LOW);
}
}

What is that Blynk.virtualWrite(V0) doing in the BLYNK_WRITE(V0) part? I think that is your problem.

As i said above ,i’m a new blink’s user.
i don’t understandt he blink language (virtual) ,i just surch the code for a wigdet timer whith an outpout.

Well, try it and remove the line, the worst thing that can happen, it’s not working :slight_smile:

If i remove this line i have an error code…
Please if someone as used this fonction : WIDGET TIMER WHITH start and stop Outpout , can you send me the code.

Thanks

What kind of error are we talking about?

My second post in this thread shows the code you require.

do not take it badly but it does not work. may be it comes from me.
I’m at the starting point …