en-us_commands:reference:itimerstart
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en-us_commands:reference:itimerstart [2026/09/07 23:35] – 바깥 편집 127.0.0.1 | en-us_commands:reference:itimerstart [2026/09/12 22:54] (current) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| Line 15: | Line 15: | ||
| ===== Example ===== | ===== Example ===== | ||
| + | |||
| + | This uses the default callback timer (Timer2). The callback changes only a flag; serial output runs in '' | ||
| <code cpp> | <code cpp> | ||
| Line 24: | Line 26: | ||
| void setup() { | void setup() { | ||
| - | | + | |
| - | ItimerSet(1000, | + | |
| - | ItimerStart(); | + | |
| } | } | ||
| void loop() { | void loop() { | ||
| if (tick) { | if (tick) { | ||
| + | noInterrupts(); | ||
| tick = false; | tick = false; | ||
| - | | + | |
| + | Serial.println(F(" | ||
| } | } | ||
| } | } | ||
| Line 39: | Line 43: | ||
| ===== Precautions ===== | ===== Precautions ===== | ||
| - | * Timer interrupt | + | * The callback runs in an interrupt. |
| - | * Do not use slow or interrupt-dependent code such as '' | + | * The callback timer without |
| - | * Normally, call '' | + | * When specifying another hardware timer, check for conflicts |
| - | * Do not use the default '' | + | * Starting before |
| - | * Explicitly using Timer1, Timer3, Timer4 or Timer5 may conflict | + | |
| - | * Configure only one '' | + | ===== Built-in Commands |
| - | * Defining an ISR for the same timer directly | + | |
| - | * '' | + | * [[: |
| + | * [[: | ||
| + | * [[: | ||
| + | * [[:en-us_commands: | ||
| [[: | [[: | ||
en-us_commands/reference/itimerstart.1788791735.txt.gz · Last modified: by 127.0.0.1
