Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import BlynkLib
- import network
- import machine
- WIFI_SSID = 'INEX108'
- WIFI_PASS = 'xxxxxxxx'
- BLYNK_AUTH = '3cfccdecb4e04cbbaa3cac8988ef9a52'
- print("Connecting to WiFi...")
- wifi = network.WLAN(network.STA_IF)
- wifi.active(True)
- wifi.connect(WIFI_SSID, WIFI_PASS)
- while not wifi.isconnected():
- pass
- print('IP:', wifi.ifconfig()[0])
- print("Connecting to Blynk...")
- blynk = BlynkLib.Blynk(BLYNK_AUTH)
- @blynk.ON("connected")
- def blynk_connected(ping):
- print('Blynk ready. Ping:', ping, 'ms')
- while True:
- blynk.run()
- print('a')
- machine.idle()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement