Question about Timers
Posted: Thu Jun 03, 2021 9:39 pm
Good day!
I want to use timers in my program to periodically execute a part of the code, without referring to any pins.
According to the documentation, to activate the timer, you need to write the following line, which usually includes the identifier (built-in number) of the timer.
But I do not specify the identifier and the timer is created and works without problems.
And two timers are created this way and work.
So the question I'm interested in is what timers (name, type, or something else) I activate with this code and how many of them can I create?
I want to use timers in my program to periodically execute a part of the code, without referring to any pins.
According to the documentation, to activate the timer, you need to write the following line, which usually includes the identifier (built-in number) of the timer.
Code: Select all
machine.Timer(id, ...)
Code: Select all
machine.Timer(mode=machine.Timer.PERIODIC, period = 2000 , callback = lambda x: set_ln2())
So the question I'm interested in is what timers (name, type, or something else) I activate with this code and how many of them can I create?