#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#define LED_PIN 18
void app_main() {
// Configure the LED pin as output
gpio_config_t io_conf;
io_conf.intr_type = GPIO_INTR_DISABLE; // Disable interrupt
io_conf.mode = GPIO_MODE_OUTPUT; // Set as output mode
io_conf.pin_bit_mask = (1ULL << LED_PIN); // Bit mask of the pins to set
io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; // Disable pull-down mode
io_conf.pull_up_en = GPIO_PULLUP_DISABLE; // Disable pull-up mode
gpio_config(&io_conf); // Configure GPIO with the given settings
printf("Hello, Wokwi!\n");
while (true) {
// Toggle the LED state
gpio_set_level(LED_PIN, 1); // Turn the LED on
vTaskDelay(500 / portTICK_PERIOD_MS);
gpio_set_level(LED_PIN, 0); // Turn the LED off
vTaskDelay(500 / portTICK_PERIOD_MS);
}
}