목차

ItimerStopAll()

ItimerStopAll()는 실행 중인 콜백 타이머를 모두 정지합니다.

ItimerStopAll 명령어 동작 흐름

void ItimerStopAll()

명령어

명령어 인수 반환값 동작
ItimerStopAll() 없음 void 실행 중인 콜백 타이머를 모두 정지합니다.

예제

기본 콜백 타이머(Timer2)를 사용합니다. 콜백에서는 플래그만 바꾸고 시리얼 출력은 loop()에서 수행합니다.

void onTimer() {}
 
void setup() {
  Serial.begin(115200);
  if (!ItimerSet(1000, onTimer)) return;  // 콜백과 주기를 먼저 설정해야 합니다.
  ItimerStart();  // 설정한 콜백 타이머를 실행합니다.
}
 
void loop() {
  static bool stopped = false;
  if (!stopped && millis() >= 5000) {
    ItimerStopAll();  // 실행 중인 모든 콜백 타이머를 정지합니다.
    stopped = true;
    Serial.println(F("timer stopped"));
  }
}

주의사항

같은 카테고리의 내장 명령어

← 내장 명령어 리스트