from machine import Pin
import network
import time
from blynkLib import Blynk
#define BLYNK_TEMPLATE_ID "TMPL3ioiBR0Ds"
#define BLYNK_TEMPLATE_NAME "MP LED"
#define BLYNK_AUTH_TOKEN "H_YlyBGoT0kc9nNWrD44kWsH-kipJ_LY"
BLYNK_AUTH_TOKEN = "H_YlyBGoT0kc9nNWrD44kWsH-kipJ_LY"
led=Pin(2,Pin.OUT)
led=Pin(4,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)
def led_control(value):
if int(value[0])==1:
led.on()
else:
led.off()
blynk.on("V1",led_control)
while True:
blynk.run()
time.sleep(0.1)