import network
import blynkLib
from machine import Pin
from utime import sleep
ssid="Wokwi-GUEST"
password=""
red=network.WLAN(network.STA_IF)
red.active(True)
red.connect(ssid,password)
while not red.isconnected():
pass #estado congelado
print("Conectado a la red",red.ifconfig())
BLYNK_AUTH_TOKEN="V63CEP4bsbwv5FWt7eg87TOpyODtnMet"
blynk=blynkLib.Blynk(BLYNK_AUTH_TOKEN)
foquito=Pin(15,Pin.OUT)
foquito2=Pin(4,Pin.OUT)
@blynk.on("V0")
def v0_handler(value):
if int(value[0]) == 1:
foquito.on()
else:
foquito.off()
@blynk.on("V1")
def v1_handler(value):
if int(value[0]) == 1:
foquito2.on()
else:
foquito2.off()
while 1:
blynk.run()