/************************************************************* You’ll need: - Blynk IoT app (download from App Store or Google Play) - NodeMCU board - Decide how to connect to Blynk (USB, Ethernet, Wi-Fi, Bluetooth, ...) There is a bunch of great example sketches included to show you how to get started. Think of them as LEGO bricks and combine them as you wish. For example, take the Ethernet Shield sketch and combine it with the Servo example, or choose a USB sketch and add a code from SendData example. *************************************************************/ /* Fill-in information from Blynk Device Info here */ #define BLYNK_TEMPLATE_ID "TMPL*****ySxFdX" #define BLYNK_TEMPLATE_NAME "New Template" #define BLYNK_AUTH_TOKEN "dmgvhVMa******AjUZjz-qtw" /* Comment this out to disable prints and save space */ #define BLYNK_PRINT Serial #include #include // Your WiFi credentials. // Set password to "" for open networks. char ssid[] = "A*****D"; char pass[] = "ad*****15"; WidgetLED led1(V1); BlynkTimer timer; // V1 LED Widget is blinking void blinkLedWidget() { if (led1.getValue()) { led1.off(); Serial.println("LED on V1: off"); } else { led1.on(); Serial.println("LED on V1: on"); } } void setup() { // Debug console Serial.begin(115200); Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass); // You can also specify server: //Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass, "blynk.cloud", 80); //Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass, IPAddress(192,168,1,100), 8080); timer.setInterval(1000L, blinkLedWidget); } void loop() { Blynk.run(); timer.run(); }