/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
/* Fill in information from Blynk Device Info here */
#define BLYNK_TEMPLATE_ID "TMPL20p8I_9X_"
#define BLYNK_TEMPLATE_NAME "Wokwi WiFi"
#define BLYNK_AUTH_TOKEN "nfwgNTF7n39xFaTJ_bewpuRrGobrIpSH"
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
// Your WiFi credentials.
// Set password to "" for open networks.
char SSID[] = "Wokwi-GUEST";
char PASS[] = "";
#define relayPin1 19
#define relayPin2 18
#define relayPin3 5
#define relayPin4 17
void setup() {
// Debug console
Serial.begin(9600);
pinMode(relayPin1, OUTPUT);
pinMode(relayPin2, OUTPUT);
pinMode(relayPin3, OUTPUT);
pinMode(relayPin4, OUTPUT);
Blynk.begin(BLYNK_AUTH_TOKEN, SSID, PASS);
}
void loop(){
Blynk.run();
}
BLYNK_WRITE(V0) {
digitalWrite(relayPin1, param.asInt());
}
BLYNK_WRITE(V1) {
digitalWrite(relayPin2, param.asInt());
}
BLYNK_WRITE(V2) {
digitalWrite(relayPin3, param.asInt());
}
BLYNK_WRITE(V3) {
digitalWrite(relayPin4, param.asInt());
}