码迷,mamicode.com
首页 > 其他好文 > 详细

esp32编程第一例

时间:2018-05-01 20:34:27      阅读:919      评论:0      收藏:0      [点我收藏+]

标签:free   delay   rtt   art   world   extern   out   变量   rest   

#include<stdio.h>
#include"freertos/FreeRtos.h"
#include"freertos/task.h"
#include"esp_system.h"
#include"esp_spi_flash.h"

void app_main()
{
printf("hellow world!\n");//打印字符串
esp_chip_info_t chip_info;//定义芯片信息结构体变量
esp_chip_info(&chip_info);//
printf("cup数量%d,wifi%s%s",chip_info.cores,
(chip_info.features&CHIP_FEATURE_BT)?"/BT":"",
(chip_info.features&CHIP_FEATURE_BLE)?"/BLE":""
);
printf("芯片修订号%d\n",chip_info.revision);
printf("%dMB %s flash\n",spi_flash_get_chip_size()/(1024*10124),
(chip_info.features&CHIP_FEATURE_EMB_FLASH)?"embedded":"external"
);
for(int i=10;i>=0;i--)
{
printf("倒计时%d秒\n",i);
vTaskDelay(1000/portTICK_PERIOD_MS);
}
printf("重启\n");
fflush(stdout);
esp_restart();
}

esp32编程第一例

标签:free   delay   rtt   art   world   extern   out   变量   rest   

原文地址:https://www.cnblogs.com/whigym/p/8976807.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!