You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/modules/tmr.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,11 @@ It is aimed at setting up regularly occurring tasks, timing out operations, and
9
9
10
10
What the tmr module is *not* however, is a time keeping module. While most timeouts are expressed in milliseconds or even microseconds, the accuracy is limited and compounding errors would lead to rather inaccurate time keeping. Consider using the [rtctime](rtctime.md) module for "wall clock" time.
11
11
12
-
NodeMCU provides 7 static timers, numbered 0-6, and dynamic timer creation function [`tmr.create()`](#tmrcreate).
13
-
14
12
!!! attention
15
13
16
-
Static timers are deprecated and will be removed later. Use the OO API initiated with [`tmr.create()`](#tmrcreate).
14
+
NodeMCU formerly provided 7 static timers, numbered 0-6, which could be
15
+
used instead of OO API timers initiated with [`tmr.create()`](#tmrcreate).
16
+
After a long period of deprecation, these were removed in 2019 Q1.
17
17
18
18
## tmr.alarm()
19
19
@@ -22,10 +22,10 @@ This is a convenience function combining [`tmr.register()`](#tmrregister) and [`
22
22
To free up the resources with this timer when done using it, call [`tmr.unregister()`](#tmrunregister) on it. For one-shot timers this is not necessary, unless they were stopped before they expired.
23
23
24
24
#### Syntax
25
-
`tmr.alarm([id/ref], interval_ms, mode, func())`
25
+
`tmr.alarm(ref, interval_ms, mode, func())`
26
26
27
27
#### Parameters
28
-
-`id`/`ref` timer id (0-6) or object, obsolete for OO API (→ [`tmr.create()`](#tmrcreate))
28
+
-`ref` timer object
29
29
-`interval_ms` timer interval in milliseconds. Maximum value is 6870947 (1:54:30.947).
30
30
-`mode` timer mode:
31
31
- `tmr.ALARM_SINGLE` a one-shot alarm (and no need to call [`tmr.unregister()`](#tmrunregister))
@@ -113,10 +113,10 @@ tmr.delay(100)
113
113
Changes a registered timer's expiry interval.
114
114
115
115
#### Syntax
116
-
`tmr.interval([id/ref], interval_ms)`
116
+
`tmr.interval(ref, interval_ms)`
117
117
118
118
#### Parameters
119
-
-`id`/`ref` timer id (0-6) or object, obsolete for OO API (→ [`tmr.create()`](#tmrcreate))
119
+
-`ref` timer object
120
120
-`interval_ms` new timer interval in milliseconds. Maximum value is 6870947 (1:54:30.947).
121
121
122
122
#### Returns
@@ -156,10 +156,10 @@ Configures a timer and registers the callback function to call on expiry.
156
156
To free up the resources with this timer when done using it, call [`tmr.unregister()`](#tmrunregister) on it. For one-shot timers this is not necessary, unless they were stopped before they expired.
0 commit comments