#define BLYNK_TEMPLATE_ID "TMPL3TfhDpNPR"
#define BLYNK_TEMPLATE_NAME "led intensity control"
#define BLYNK_AUTH_TOKEN "BR839iG7iO48GGmPUA90jjBEykRRXoh8""
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
char auth[] = "BR839iG7iO48GGmPUA90jjBEykRRXoh8"; // Your Blynk Auth Token
char ssid[] = "Wokwi-GUEST"; // Your WiFi network SSID
char pass[] = ""; // Your WiFi network password
int ledPin = 2; // LED connected to GPIO 2 (you can change this pin)
int potPin = 34; // Potentiometer connected to GPIO 34 (you can change this pin)
BlynkTimer timer;
void setup() {
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
pinMode(ledPin, OUTPUT);
}
void loop() {
Blynk.run();
timer.run();
}
BLYNK_WRITE(V1) {
int intensity = param.asInt(); // Get value from the potentiometer widget
analogWrite(ledPin, intensity); // Control LED brightness using PWM
}