Created
May 28, 2023 13:57
-
-
Save saurabh47/651d18fdf37b26d874062dc9823e881f to your computer and use it in GitHub Desktop.
Controlling Wemos D1 min ESP8266 using Blynk App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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