RT-Thread Studio 快速上手

本文可以帮助解决RT-Thread文档中心中RT-Thread Studio-应用开发-快速上手遇到的没有加载函数的问题。

RT-Thread Studio 快速上手_第1张图片

'A' undeclared (first use in this function) 从提示上看是缺少了引用,那么该引用什么呢?需要引用#include 和#include

具体代码如下:

/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-10-31     RT-Thread    first version
 */

#include 
#include 
#include 


#define DBG_TAG "main"
#define DBG_LVL DBG_LOG
#include 

/*PLEASE DEFINE the LED0 pin for your board,such as:PA5*/
#define LED0_PIN GET_PIN(A,5)

int main(void)
{
    int count = 1;
    /*set LED0 pin mode to output*/
    rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);

    while (count++)
    {
        /*set LED0 pin level to high or low*/
        rt_pin_write(LED0_PIN, count % 2);
        LOG_D("Hello RT-Thread!");
        rt_thread_mdelay(1000);
    }

    return RT_EOK;
}


 

 

你可能感兴趣的:(RT-Thread,嵌入式)