from gpiozero import LED
import BlynkLib
import time
led1 = LED(25)
BLYNK_AUTH = 'YourAuthToken'
# Initialize Blynk
blynk = BlynkLib.Blynk(BLYNK_AUTH)
# Register Virtual Pins
@blynk.VIRTUAL_WRITE(1)
def my_write_handler(value):
print('Current V1 value: {}'.format(value))
if int(value) == 1:
led1.on()
else:
led1.off()
# Start Blynk (this call should never return)
blynk.run()
Comments