#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "TMPL6JaFmfyZD"
#define BLYNK_TEMPLATE_NAME "led"
#define BLYNK_AUTH_TOKEN "OydJZcZvVT3wT5XLpPwrtgjtjAXJddrX"
#include <BlynkSimpleEsp32.h>
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "Wokwi-GUEST";
char pass[] = "";
int red = 12;
int button;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
pinMode(red, OUTPUT);
}
BLYNK_WRITE (V3)
{
button = param.asInt();
if (button ==1) {
digitalWrite(red, HIGH);
}
else {
digitalWrite(red, LOW);
}
}
void loop() {
Blynk.run();
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}