Skip to content

Instantly share code, notes, and snippets.

@saurabh47
Created May 28, 2023 13:57
Show Gist options
  • Select an option

  • Save saurabh47/651d18fdf37b26d874062dc9823e881f to your computer and use it in GitHub Desktop.

Select an option

Save saurabh47/651d18fdf37b26d874062dc9823e881f to your computer and use it in GitHub Desktop.
Controlling Wemos D1 min ESP8266 using Blynk App
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#define BLYNK_AUTH_TOKEN "YourBlynkToken"
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";
void setup() {
Serial.begin(115200);
pinMode(D1, OUTPUT);
pinMode(D2, OUTPUT);
pinMode(D5, OUTPUT);
pinMode(D6, OUTPUT);
Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
delay(10);
}
BLYNK_CONNECTED() {
Blynk.syncAll();
}
BLYNK_WRITE(V1) {
digitalWrite(D1, param.asInt());
}
BLYNK_WRITE(V2) {
digitalWrite(D2, param.asInt());
}
BLYNK_WRITE(V5) {
digitalWrite(D5, param.asInt());
}
BLYNK_WRITE(V6) {
digitalWrite(D6, param.asInt());
}
void loop() {
Blynk.run();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment