from machine import Pin
import network
import time
from blynkLib import Blynk
BLYNK_AUTH_TOKEN ="JVspJCrGRtr4gXv4PxFXrevPk7JAS3C9"
led=Pin(5,Pin.OUT)
wifi= network.WLAN(network.STA_IF)
wifi.active(True)
wifi.connect("Wokwi-GUEST","")
while not wifi.isconnected():
pass
print("Wifi Connected Successfully")
blynk= Blynk(BLYNK_AUTH_TOKEN)
def led_control(value):
if int(value[0])==1:
led.on()
else:
led.off()
blynk.on("V0",led_control)
while True:
blynk.run()
time.sleep(0.1)