发帖
6 0 0

WB2 示例代码入门---helloworld

ckdsx.cn
论坛元老

72

主题

164

回帖

4976

积分

论坛元老

积分
4976
Ai-WB2系列 1302 6 2023-9-8 16:16:46
/* 以下注释
* @Author: xuhongv@yeah.net xuhongv@yeah.net
* @Date: 2022-10-03 15:02:19
* @LastEditors: xuhongv@yeah.net xuhongv@yeah.net
* @LastEditTime: 2022-10-08 14:55:16


* @Description: Hello world
*/
#include <stdio.h>  //standard input optput.header = 标准输入输出头文件,**.文件一般为头文件
#include <string.h> //字符串头文件
#include <FreeRTOS.h> //嵌入系统头文件
#include <task.h> //任务头文件
#include <blog.h> //私有文件需要查询手册
#include "bl_sys.h" //私有文件需要查询手册 猜测bl芯片系统头文件

void main(void)  //主函数
{

    printf("Hello World.\r\n");  //串口打印输出“Hello World.”,\r\n=转义字符;
    for (int i = 10; i >= 0; i--) //for循环结构
    {
        printf("Restarting in %d seconds...\r\n", i);  //串口打印输出多少秒
        vTaskDelay(1000 / portTICK_PERIOD_MS); //延时函数
    }
    printf("Restarting now.\r\n"); //串口打印输出“现在重启”

    bl_sys_reset_por(); //重启
}
----------------------

* @文件位置: \Ai-Thinker-WB2\applications\get-started\helloworld\helloworld\main.c


程序添加注释,还有问题,请留言!


──── 0人觉得很赞 ────

使用道具 举报

2023-9-8 16:21:04
就喜欢这种每行都注释的
2023-9-8 16:28:00
打卡!
2023-9-8 16:37:16
老师怎么在windows里装wb2环境
2023-9-8 19:33:00
学习打卡
2023-9-9 08:09:22
hello
2023-9-15 17:29:40
学习
您需要登录后才可以回帖 立即登录
高级模式
返回
统计信息
  • 会员数: 28100 个
  • 话题数: 39320 篇