Mar-07-2020, 12:23 PM
Using the github bylnkkk for raspberry pi 3 (via ethernet) on python3 (https://github.com/blynkkk/lib-python), (0.2.6) it connects okay (using blynk server) and I can set the value of a virtual pin, but I just can't figure
out how to read the value of one or use an interrupt / thread / function to run when its state is changed.
Writing 1 to virtual pin 4 works:
out how to read the value of one or use an interrupt / thread / function to run when its state is changed.
Writing 1 to virtual pin 4 works:
blynk.virtual_write(4, 1)but neither of these work: (I don't get anything printed when I change the state of V4)
@blynk.handle_event('read V4') def read_virtual_pin_handler(pin): print("po") #print(READ_PRINT_MSG.format(pin)) #print(blynk.virtual_sync(pin)) #print(sensor_data) blynk.notify('Warning critical value') #blynk.virtual_write(pin, random.randint(0, 255)) @blynk.handle_event('write V4') def write_virtual_pin_handler(pin, value): print(WRITE_EVENT_PRINT_MSG.format(pin, value)) blynk.notify('bpush')Any ideas how I can use python & blynk with my pi? Thanks