【BG22-EK4108A 蓝牙开发套件】 一 、 环境搭建+点灯
[复制链接]
1.
开发环境搭建
第1步:
请移步https://www.silabs.com/documents/login/software/SimplicityStudio-5.iso下载并安装 Simplicity Studio 版本 5(仅windows版本)其他版本请参照官网
如遇到需要**.dll请安装运行库合集
其他不再啰嗦。。。。。。
第 2 步:
插上套件,打开电脑设备管理器更新或者安装Jlink驱动程序使用 Simplicity Studio 来安装所需的 SDK
先点击install会调出Installation Manager对话框点击Install by connecting device(s)点击NEXT
至此环境搭建完成!
2.新建工程
点击File单击Create New Project如果您已连接或选择了目标,则所有信息都已预先填充。否则,您可以在此处选择mcu。单击下一步。
#include "sl_component_catalog.h"
#include "sl_system_init.h"
#include "app.h"
#if defined(SL_CATALOG_POWER_MANAGER_PRESENT)
#include "sl_power_manager.h"
#endif // SL_CATALOG_POWER_MANAGER_PRESENT
#if defined(SL_CATALOG_KERNEL_PRESENT)
#include "sl_system_kernel.h"
#else // SL_CATALOG_KERNEL_PRESENT
#include "sl_system_process_action.h"
#endif // SL_CATALOG_KERNEL_PRESENT
int main(void)
{
// Initialize Silicon Labs device, system, service(s) and protocol stack(s).
// Note that if the kernel is present, processing task(s) will be created by
// this call.
sl_system_init();
// Initialize the application. For example, create periodic timer(s) or
// task(s) if the kernel is present.
app_init();
#if defined(SL_CATALOG_KERNEL_PRESENT)
// Start the kernel. Task(s) created in app_init() will start running.
sl_system_kernel_start();
#else // SL_CATALOG_KERNEL_PRESENT
while (1) {
// Do not remove this call: Silicon Labs components process action routine
// must be called from the super loop.
sl_system_process_action();
// Application process.
app_process_action();
#if defined(SL_CATALOG_POWER_MANAGER_PRESENT)
// Let the CPU go to sleep if the system allows it.
sl_power_manager_sleep();
#endif
}
#endif // SL_CATALOG_KERNEL_PRESENT
}
以上是点灯源码
至此点灯完成,下一步添加外设温湿度传感器
运行库上传失败,
如果需要请留言
|