烽火社区
标题: 【Arch BLE】实验二 串口测试 [打印本页]
作者: 菩提树下的人 时间: 2015-12-29 11:48 PM
标题: 【Arch BLE】实验二 串口测试
本次实验是该系列实验的第二个,测试Arch ble的串口。
一、实验目的
1.了解mbed的库函数
2.掌握Arch BLE串口配置以及使用
二、实验基本要求
1. 阅读和理解官方wiki上的资源
2. 通过实验从串口吐出调试信息
三、实验环境
硬件平台:Arch BLE
软件平台:mbed
四、实验内容
1.软件平台搭建
a)首先在mbed官网注册帐号:https://developer.mbed.org
b)安装mbed驱动,可支持虚拟串口:https://developer.mbed.org/handbook/Windows-serial-configuration
2. 硬件平台:
只需要使用Arch BLE本身即可,不需要额外的配件。
3.实验测试代码
#include "mbed.h"
DigitalOut led(LED1);
Serial com(p8, p7);
int main()
{
uint16_t loop=0;
com.baud(115200);
while(1)
{
led = !led;
com.printf("Hello ICKey, %drn",++loop);
wait(1.0);
}
}
4.测试结果
[attach]33368[/attach]
欢迎光临 烽火社区 (http://bbs.cnecport.com/) |
Powered by Discuz! X3.2 |