#include <WiFi.h>
#include <BlynkSimpleEsp32.h>
// Your WiFi credentials (These are not used in Wokwi but required by the code)
char ssid[] = "Your_SSID";
char pass[] = "Your_PASSWORD";
// Blynk Authentication Token (Not used in Wokwi, but required by the code)
char auth[] = "Your_Blynk_Auth_Token";
// Define the pin for the LED
#define LED_PIN 5
// Simulate the Blynk Virtual Pin for the button
#define VIRTUAL_PIN V1
void setup() {
// Start the serial communication
Serial.begin(115200);
// Set the LED pin as an output
pinMode(LED_PIN, OUTPUT);
// Initialize the LED to be off
digitalWrite(LED_PIN, LOW);
Serial.println("Setup complete. Ready to simulate Blynk button press.");
}
void loop() {
// Simulate Blynk.run() (not used in Wokwi but required by the original code)
// Simulate button press on Wokwi
if (Serial.available()) {
char input = Serial.read();
if (input == '1') {
digitalWrite(LED_PIN, HIGH);
Serial.println("Bike ON");
} else if (input == '0') {
digitalWrite(LED_PIN, LOW);
Serial.println("Bike OFF");
}
}
}