Luat_ESP32_S3_Playground/main/main.c

36 lines
754 B
C

#include <inttypes.h>
#include <stdio.h>
/* FreeRTOS */
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
/* ESP */
#include "driver/gpio.h"
#include "esp_log.h"
#define LED0_PIN 10
static const char *LOG_TAG = "MAIN";
void app_main(void) {
ESP_LOGI(LOG_TAG, "Hello world");
gpio_config_t led_cfg = {
.pin_bit_mask = (1U << LED0_PIN),
.mode = GPIO_MODE_OUTPUT,
.intr_type = GPIO_INTR_DISABLE,
.pull_down_en = GPIO_PULLDOWN_DISABLE,
.pull_up_en = GPIO_PULLUP_DISABLE,
};
gpio_config(&led_cfg);
for (;;) {
gpio_set_level(LED0_PIN, 1);
vTaskDelay(pdMS_TO_TICKS(50));
gpio_set_level(LED0_PIN, 0);
vTaskDelay(pdMS_TO_TICKS(950));
}
}