Hi,
I cannot get more than a timer to work with Python and I’m not sure if it’s possible. Here’s a test code:
#!/usr/bin/python3
# import libraries
import BlynkLib
import time
BLYNK_AUTH = '**'
# set virtual pins
t1 = 17
t2 = 18
# Initialize Blynk
blynk = BlynkLib.Blynk(BLYNK_AUTH)
@blynk.VIRTUAL_READ(t1)
def test1():
t = time.localtime()
s = t.tm_sec
print('Test_1: {}'.format(s))
blynk.virtual_write(t1, str(s))
@blynk.VIRTUAL_READ(t2)
def test2():
t = time.localtime()
s = t.tm_sec
print('Test_2: = {}'.format(s))
blynk.virtual_write(t2, str(s))
#activate timers
blynk.set_user_task(test1, 3000)
blynk.set_user_task(test2, 5000)
# Start Blynk (this call should never return)
blynk.run()
and this’ what I get. Test 1 doesn’t fire:
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
///_, /////_
/__/Give Blynk a Github star! => GitHub - vshymanskyy/blynk-library-python: Blynk library for Python. Works with Python 2, Python 3, MicroPython.
TCP: Connecting to blynk-cloud.com:80
Blynk connection successful, authenticating…
Access granted, happy Blynking!
Test_2: = 58
Test_2: = 3
Test_2: = 8
Test_2: = 13
Test_2: = 18
Test_2: = 23
Test_2: = 28