BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Blynk commands


#1

Is there a list of Blynk commands somewhere with examples of usage / syntax?


#2

http://docs.blynk.cc


#3

If I have trouble linking a library, can I just open the library, copy all the code, and paste it into my sketch?


#4

What do you mean? Did you try using example sketches in the Arduino IDE?


#5

I had installed the library in the library folder and had included the "#include <SimpleTimer.h> line in the sketch itself, but forgot to click on “Include Library” under the Sketch which I guess you have to do. So I got it to include the library. Now, when the compiler encounters this line “timer.setInterval(5000L,check);”, it aborts with the error “‘check’ was not declared in this scope”. I copied several examples. See code below. Thanks again everyone.

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <Time.h>

char auth[] = "XXXXXXXXXXXX";
#define BLYNK_PRINT Serial  
#define WIFI_SSID  "XXXXxxxxxx6"
#define WIFI_PASS  "XXxxxx"
#define ESP8266_LED 5

SimpleTimer timer;

void setup()
{
  pinMode(0, INPUT);
  pinMode(ESP8266_LED, OUTPUT);
    
  Serial.begin(9600);
  Blynk.begin(auth, WIFI_SSID, WIFI_PASS);
  timer.setInterval(5000L,check);
}

void check()
{

int wash = !digitalRead(0);  
  if (wash == HIGH) {
  Blynk.virtualWrite(V2, HIGH);
  digitalWrite(5, HIGH);
   Blynk.notify("Done");}
    else {
      Blynk.virtualWrite(V2, LOW);
     digitalWrite(5, LOW);
   }
}

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

#6

[quote=“MJC57, post:5, topic:3929”]S
void setup()
{
[/quote]

I think I figured this one out. You have to have the check function ahead of the setup function. I did that and it compiled. It wasn’t done that way in the examples I looked at so I didn’t think it mattered.


#7

@MJC57 Just FYI, you might want to obscure your auth code and wifi credentials. :grinning:


#8

Yes. I realized as soon as I hit reply that I forgot to obscure it. Thanks.


#9

@MJC57 You can edit by clicking the “pencil” icon right below your post.


#10

Where can I find all the variations and options of blynk commands … blynk.run, blynk.connect, blynk. setProperty, blynk.syncAll, blynk.virtualWrite, blynk dot etc etc …the docs.blynk.cc only lists a few?


#11

If you need ALL of them, the good source of information is the source code: https://github.com/blynkkk/blynk-library