Created
August 28, 2023 19:23
-
-
Save esmarr58/eef5cc350a5b6262ae81ce1e362ae51b to your computer and use it in GitHub Desktop.
Blink example for esp32-s3 on expressif sdk, for embbed class 2023B, UdG, Cucei. Seminario de Sistemas Embebidos.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdbool.h> | |
#include <unistd.h> | |
#include "freertos/FreeRTOS.h" | |
#include "freertos/task.h" | |
#include "driver/gpio.h" | |
#include "esp_log.h" | |
#include "sdkconfig.h" | |
#define pin_GPIO 46 | |
#define periodo_LED 1000 //ms | |
static uint8_t estado_led = 0; | |
static const char *TAG = "mensaje"; | |
static const char *TAG2 = "error"; | |
void app_main(void) | |
{ | |
/*Configurar led */ | |
sleep(5); | |
gpio_reset_pin(pin_GPIO); | |
gpio_set_direction(pin_GPIO, GPIO_MODE_OUTPUT); | |
printf("Mensaje # 1\n"); | |
ESP_LOGI(TAG, "Mensaje # 2"); | |
ESP_LOGI(TAG2, "Mensaje # 3"); | |
while (true) { | |
gpio_set_level(pin_GPIO, estado_led); | |
estado_led = !estado_led; | |
//vTaskDelay(periodo_LED / portTICK_PERIOD_MS); | |
usleep(1000000); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment