docs/esp8266/quickref: Note that timers supported are virtual ones.

pull/1936/head
Paul Sokolovsky 2016-03-25 16:44:13 +02:00
rodzic e589cddcd4
commit 159f1aaca8
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -82,11 +82,12 @@ Use the ``time`` module::
Timers
------
Use the ``machine.Timer`` class::
Virtual (RTOS-based) timers are supported. Use the ``machine.Timer`` class
with timer ID of -1::
from machine import Timer
tim = Timer(0)
tim = Timer(-1)
tim.init(period=5000, mode=Timer.ONE_SHOT, callback=lambda t:print(1))
tim.init(period=2000, mode=Timer.PERIODIC, callback=lambda t:print(2))