#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "driver/gpio.h"
#include "esp_log.h"
#define delay(value) vTaskDelay(value / portTICK_PERIOD_MS)
#define pin_led GPIO_NUM_1
static const char *TAG = "GPIO_INPUT";
void app_main() {
//zero-initialize the config structure.
gpio_config_t io_conf = {};
//disable interrupt
io_conf.intr_type = GPIO_INTR_DISABLE;
//set as output mode
io_conf.mode = GPIO_MODE_OUTPUT;
//bit mask of the pins that you want to set,e.g.GPIO18/19
// io_conf.pin_bit_mask = 0B00000000000000000000000000000010;
io_conf.pin_bit_mask = (1 << pin_led);
//disable pull-down mode
io_conf.pull_down_en = 0;
//disable pull-up mode
io_conf.pull_up_en = 0;
//configure GPIO with the given settings
gpio_config(&io_conf);
for (;;) {
gpio_set_level(pin_led, 1);
ESP_LOGE(TAG, "high");
delay(500);
gpio_set_level(pin_led, 0);
ESP_LOGE(TAG, "low");
delay(500);
}
}