#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(); }