/*************************************************************
This sketch shows how to read values from Virtual Pins
App dashboard setup:
Slider widget (0...100) on Virtual Pin V1
*************************************************************/
/* Fill-in information from Blynk Device Info here */
#define BLYNK_TEMPLATE_ID "TMPL6lk7A-4eL"
#define BLYNK_TEMPLATE_NAME "champagne"
#define BLYNK_AUTH_TOKEN "9eez7w0vz7DWKKjVT11KlwOHVma0cNal"
#define Led 12
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "Wokwi-GUEST";
char pass[] = "";
// This function will be called every time Slider Widget
// in Blynk app writes values to the Virtual Pin V1
BLYNK_WRITE(V13)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
Serial.println(pinValue);
if (pinValue == 1){
digitalWrite(Led, HIGH);
}
else {
digitalWrite(Led, LOW);
}
// process received value
}
int LED_Status = 2;
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);
pinMode(Led, OUTPUT); }
void loop()
{
Blynk.run(); digitalWrite(LED_Status, 1);
}