LED ON/OFF Using Blynk
Program
/
#define BLYNK_AUTH_TOKEN "auth token"
#define BLYNK_TEMPLATE_ID "template id"
#define BLYNK_TEMPLATE_NAME "LED control "
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "wifi name"; // Enter your Wifi Username
char pass[] = "wifi password"; // Enter your Wifi password
int ledpin = D2; // GPIO 2 (means connect LED to D4 pin)
void setup()
{
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
pinMode(ledpin,OUTPUT);
}
void loop()
{
Blynk.run();
}
Comments
Post a Comment