#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
void app_main(void) {
// Configura GPIO2 come output
gpio_set_direction(GPIO_NUM_2, GPIO_MODE_OUTPUT);
while (1) {
// LED HIGH
asm volatile(
"li t0, 0x60004000\n\t"
"li t1, 0x08\n\t"
"add t1, t0, t1\n\t"
"li t3, 0x4\n\t" // GPIO2 mask
"sw t3, 0(t1)\n\t"
);
vTaskDelay(500 / portTICK_PERIOD_MS);
// LED LOW
asm volatile(
"li t0, 0x60004000\n\t"
"li t2, 0x08\n\t"
"add t2, t0, t2\n\t"
"li t3, 0x4\n\t"
"sw t3, 0(t2)\n\t"
);
vTaskDelay(500 / portTICK_PERIOD_MS);
}
}
Loading
esp32-c3-devkitm-1
esp32-c3-devkitm-1