0% found this document useful (0 votes)
22 views

blynk - esp8266

Uploaded by

Krishna Prasad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

blynk - esp8266

Uploaded by

Krishna Prasad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

// Include the library files

#define BLYNK_PRINT Serial


#define BLYNK_TEMPLATE_ID ""
#define BLYNK_TEMPLATE_NAME ""
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// Define the LED pin


#define ledPin D1
#define BLYNK_AUTH_TOKEN "" // Enter your Blynk Auth Token

char auth[] = BLYNK_AUTH_TOKEN;


char ssid[] = ""; // Enter your WiFi name
char pass[] = ""; // Enter your WiFi password

// Get the button value


BLYNK_WRITE(V0) {
bool value = param.asInt();
// Check this value and turn the LED ON and OFF
if (value == 1) {
digitalWrite(ledPin, LOW);
} else {
digitalWrite(ledPin, HIGH);
}
}
void setup() {
Serial.begin(9600);
delay(100);
// Set the LED pin as an output pin
pinMode(ledPin, OUTPUT);
// Turn OFF the LED
digitalWrite(ledPin, HIGH);

// Initialize the Blynk library


Blynk.begin(auth, ssid, pass, "blynk.cloud", 80);
}
void loop() {
// Run the Blynk library
Blynk.run();
}

You might also like