I tried the following code, but the GPIO18 is not changing
Code: Select all
#include <stdio.h>
#include "driver/gpio.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include <unistd.h>
#define LED_PIN 18
void app_main(void)
{
gpio_set_direction(GPIO_NUM_18, GPIO_MODE_OUTPUT);
int ON = 0;
while(true)
{
ON = !ON;
gpio_set_level(GPIO_NUM_18, ON);
sleep(1);
}
}