en-us_commands:reference:igettime
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en-us_commands:reference:igettime [2026/09/07 23:35] – 바깥 편집 127.0.0.1 | en-us_commands:reference:igettime [2026/09/14 20:30] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 14: | Line 14: | ||
| ===== Example ===== | ===== Example ===== | ||
| + | |||
| + | This example selects MPINO-8A4R(T)-S and uses input '' | ||
| <code cpp> | <code cpp> | ||
| - | const uint8_t | + | const uint8_t |
| - | const uint8_t RESET_INPUT | + | unsigned long lastPrint |
| - | const uint8_t RUN_OUTPUT = 32; | + | |
| void setup() { | void setup() { | ||
| Line 25: | Line 26: | ||
| void loop() { | void loop() { | ||
| - | const bool start = IdigitalRead(START_INPUT, | + | const bool inputOn |
| - | const bool reset = IdigitalRead(RESET_INPUT, | + | Iton(0, |
| - | | + | const unsigned long elapsedMs |
| - | const bool stopDelay | + | |
| - | const bool startPulse = Itpl(2, ready, 200); // (Pulse Timer) Return true for the set duration | + | |
| - | | + | Serial.println(elapsedMs); |
| - | const bool batchDone | + | |
| - | const unsigned long elapsed | + | |
| - | const bool savedDone = IgetState(4); | + | |
| - | + | ||
| - | digitalWrite(RUN_OUTPUT, | + | |
| - | if (inspectionWindow && elapsed % 1000 < 20) { | + | |
| - | Serial.println(savedDone ? F(" | + | |
| } | } | ||
| } | } | ||
| Line 44: | Line 38: | ||
| ===== Precautions ===== | ===== Precautions ===== | ||
| - | * Timer interrupt callbacks run inside an ISR. For safety, change only flags in the callback and perform actual control processing | + | * Call the timer command repeatedly |
| - | * Do not use slow or interrupt-dependent code such as '' | + | * Do not share a '' |
| - | * Normally, call '' | + | * Call the timer with the same ID first. An ID that has not been created returns 0. |
| - | * Do not use the default '' | + | |
| - | * Explicitly using Timer1, Timer3, Timer4 or Timer5 may conflict with PWM, analog output or high-speed counter functions using that timer. | + | ===== Built-in Commands |
| - | * Configure only one '' | + | |
| - | * Defining an ISR for the same timer directly | + | * [[: |
| - | * '' | + | |
| [[: | [[: | ||
en-us_commands/reference/igettime.1788791734.txt.gz · Last modified: by 127.0.0.1
