About Timer usage question. #11871
Answered
by
robert-hh
water5
asked this question in
RP2040 / Pico
-
from machine import Timer
def test_1(v):
print('test_1')
def test_2(v):
print('test_2')
def test_3(v):
print('test_3')
tim = Timer(period = 1650, mode = Timer.PERIODIC, callback = test_1)
tim = Timer(period = 2650, mode = Timer.PERIODIC, callback = test_2)
tim = Timer(period = 2650, mode = Timer.PERIODIC, callback = test_3)
tim.deinit()
# stop call `test_3` periodically.
tim.deinit()
# do nothing?
tim.deinit()
# do nothing? Is it normal about above result? |
Beta Was this translation helpful? Give feedback.
Answered by
robert-hh
Jun 26, 2023
Replies: 1 comment
-
You assigned all timers to the same python object, instead of e.g. using tim1, tim2, tim3 for the three timers. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
water5
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You assigned all timers to the same python object, instead of e.g. using tim1, tim2, tim3 for the three timers.