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

This commit is contained in:
Paul Sokolovsky 2016-03-25 16:44:13 +02:00
parent e589cddcd4
commit 159f1aaca8

View File

@ -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))