from machine import Pin
import network
import time
from blynkLib import Blynk
BLYNK_AUTH_TOKEN = "clg6M9A5VuTJlKDsNkYOI2vyplP5tuNA"
led=Pin(2,Pin.OUT)
switch_pin = machine.Pin(6, machine.Pin.IN)
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)