#define BLYNK_TEMPLATE_ID "TMPLpse15f9V"
#define BLYNK_DEVICE_NAME "test template"
#define BLYNK_AUTH_TOKEN "SK1yIEKHGLG4Z2ZIh7kIW7BzN_8anWVq"
#include <WiFi.h>
#include<WiFiClient.h>
#include<BlynkSimpleEsp32.h>
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "Wokwi-GUEST";
char pass[] = "";
int vsw1,sw1,count=0;
BLYNK_CONNECTED(){
Blynk.syncVirtual(V1);
}
BLYNK_WRITE(V1){
vsw1 = param.asInt(); }
void setup() {
Serial.begin(115200);
Blynk.begin(auth, ssid ,pass);
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(14, OUTPUT);
pinMode(27, OUTPUT);
pinMode(26, OUTPUT);
pinMode(25, OUTPUT);
pinMode(15, INPUT_PULLUP);
}
void loop() {
Blynk.run();
sw1=digitalRead(15);
if((vsw1==1)||(sw1==0)){
count++;
if(count>6){
count=1;
}
}
if(count==1){
digitalWrite(13, HIGH);
digitalWrite(12, LOW);
digitalWrite(14, LOW);
digitalWrite(27, LOW);
digitalWrite(26, LOW);
digitalWrite(25, LOW);
}
else if(count==2){
digitalWrite(13, LOW);
digitalWrite(12, HIGH);
digitalWrite(14, LOW);
digitalWrite(27, LOW);
digitalWrite(26, LOW);
digitalWrite(25, LOW);
}
else if(count==3){
digitalWrite(13, LOW);
digitalWrite(12, LOW);
digitalWrite(14, HIGH);
digitalWrite(27, LOW);
digitalWrite(26, LOW);
digitalWrite(25, LOW);
}
else if(count==4){
digitalWrite(13, LOW);
digitalWrite(12, LOW);
digitalWrite(14, LOW);
digitalWrite(27, HIGH);
digitalWrite(26, LOW);
digitalWrite(25, LOW);
}
else if(count==5){
digitalWrite(13, LOW);
digitalWrite(12, LOW);
digitalWrite(14, LOW);
digitalWrite(27, LOW);
digitalWrite(26, HIGH);
digitalWrite(25, LOW);
}
else if(count==6){
digitalWrite(13, LOW);
digitalWrite(12, LOW);
digitalWrite(14, LOW);
digitalWrite(27, LOW);
digitalWrite(26, LOW);
digitalWrite(25, HIGH);
}
delay(300);
}