I have successfully got my RPi online using Blynk 2.0 with the latest Python Blynk Library. I have three widgets on the web and mobile (android) dashboards; a button (led control) and 2 gauges (temp and humidity readings). The gauges display the correct readings on both dashboards. However, the led control is very problematic; sometimes it works once and stops and sometimes it does not work at all. Below is the python code I am using for controlling the led. I would appreciate your help in having a solid repeatable led control.
import time
import board
import adafruit_dht
from digitalio import DigitalInOut, Direction, Pull
import BlynkLib
#Define Digital PIN on GPIO
led = DigitalInOut(board.D18)
led.direction = Direction.OUTPUT
# Register Virtual Pins
@blynk.on("V0")
def v0_write_handler(value):
print('Current V0 value: {}'.format(value[0]))
if int(format(value[0])) == 1:
led.value= True
else:
led.value=False
blynk.run()