-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlynk_Control.ino
48 lines (34 loc) · 938 Bytes
/
Blynk_Control.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// download blynk library from https://github.com/blynkkk/blynk-library/releases
// source code (zip)
// add the .zip file library to the code
#include <Blynk.h>
#define BLYNK_PRINT Serial
int pin = 2;
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "your auth code";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "your ssid";
char pass[] = "your pswd ";
void setup() {
pinMode(pin, OUTPUT);
Serial.begin(115200);
delay(10);
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
Serial.println("WiFi connected");
Blynk.begin(auth, ssid, pass);
}
void loop(){
Blynk.run();
}