#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "esp_log.h" // 引用日誌標頭
#define CONFIG_LOG_MAXIMUM_LEVEL 5 // 日誌輸出設至為最高等級
static const char *TAG = "COUNTER"; // 自訂程式識別名稱
static int count = 0;
void app_main(void) {
esp_log_level_set(TAG, ESP_LOG_VERBOSE); // 設定日誌等級
while (1) {
ESP_LOGI(TAG, "計數值:%d", count); // 輸出日誌
count++;
vTaskDelay(pdMS_TO_TICKS(500));
}
}Loading
esp32-s3-devkitc-1
esp32-s3-devkitc-1