en-us_commands:reference:tcntsetup
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| en-us_commands:reference:tcntsetup [2026/09/07 21:52] – 만듦 - 바깥 편집 127.0.0.1 | en-us_commands:reference:tcntsetup [2026/09/08 00:53] (current) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| <code cpp> | <code cpp> | ||
| - | TCNTSETUP(1, true); | + | const uint8_t COUNTER_TIMER = 1; |
| + | |||
| + | void setup() { | ||
| + | Serial.begin(115200); | ||
| + | | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | static uint16_t previousOverflow = 0; | ||
| + | const uint16_t overflowCount = TCNTOUT(COUNTER_TIMER); | ||
| + | if (overflowCount != previousOverflow) { | ||
| + | previousOverflow = overflowCount; | ||
| + | Serial.println(overflowCount); | ||
| + | } | ||
| + | } | ||
| </ | </ | ||
| Line 25: | Line 39: | ||
| * Do not interpret '' | * Do not interpret '' | ||
| * In interrupt ISRs on other products, perform no work other than incrementing the count. | * In interrupt ISRs on other products, perform no work other than incrementing the count. | ||
| + | |||
| + | ===== Built-in Commands in the Same Category ===== | ||
| + | |||
| + | * [[: | ||
| [[: | [[: | ||
en-us_commands/reference/tcntsetup.1788785569.txt.gz · Last modified: by 127.0.0.1
