安信可科技

Hello World



Hello World

This example demonstrates how to start a task and print “Hello World” at intervals

When using the project for the first time, you must execute make menuconfig before compiling

Preparation

hardware:

  • ESP32S module
  • USB to TTL

software:

  • Cygwin + Eclipse development environment
  • Serial port tool

Code

#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "nvs_flash.h"
 
void helloworld_task(void *pvParameter)
{
    while(1)
    {
        printf("Hello world!\r\n");
        vTaskDelay(1000 / portTICK_RATE_MS); //interval 1000 ms
    }
}
 
void app_main()
{
    nvs_flash_init(); //nvs flash initialization
    system_init(); //System initialization
 
    printf("Creat Hello World task \r\n");
 
    xTaskCreate(&helloworld_task, "helloworld_task", 2048, NULL, 5, NULL); //Create a hello world task
}

Burning

Refer to 如何为 ESP 系列模组烧录固件 to download

Or refer to 如何使用安信可 ESP 系列一体化开发环境 to configure make flash, and click Download taget in the project to complete the download

Run

End