查看: 2547|回复: 1

【LinkSprite试用】HRM检测问题

[复制链接]
  • TA的每日心情
    开心
    2020-2-14 12:16
  • 签到天数: 827 天

    连续签到: 1 天

    [LV.10]以坛为家III

    发表于 2016-4-17 21:41:39 | 显示全部楼层 |阅读模式
    分享到:
    接上一个帖子https://www.cirmall.com/bbs/thread-47276-1-1.html

    在手机端安装NORDIC官方的NRF TOOLBOX应用,这是NORDIC官方的工具箱,内置丰富的测试功能。
    在mbed界面选择import,程序库里搜索BLE_HeartRate程序并将它导入到MBED中。
    1.JPG
    编译完看见程序和爱板网https://www.cirmall.com/evaluation/mbed-ble-sensors-tag/5/中main程序不一样
    评测文章
    1. int main(void)
    2. {
    3.     led1 = 1;
    4.     led2 = 0;
    5.     Ticker ticker;
    6.     ticker.attach(periodicCallback, 1); // blink LED every second

    7.     BLE& ble = BLE::Instance(BLE::DEFAULT_INSTANCE);
    8.     ble.init(bleInitComplete);

    9.     /* SpinWait for initialization to complete. This is necessary because the
    10.      * BLE object is used in the main loop below. */
    11.     while (ble.hasInitialized()  == false) { /* spin loop */ }

    12.     // infinite loop
    13.     while (1) {
    14.         // check for trigger from periodicCallback()
    15.         if (!key_p)
    16.          {
    17.              wait_ms(10);
    18.              if (!key_p)
    19.               hrmCounter++;
    20.              while (!key_d);
    21.              }
    22.         if (!key_d)
    23.          {
    24.              wait_ms(10);
    25.              if (!key_d)
    26.               hrmCounter--;
    27.               while (!key_d);
    28.         }
    29.         hrService->updateHeartRate(hrmCounter);
    30.             ble.waitForEvent(); // low power wait for event
    31.         
    32.     }
    33. }
    复制代码
    mbed库文件如下
    1. int main(void)
    2. {
    3.     led1 = 1;
    4.     Ticker ticker;
    5.     ticker.attach(periodicCallback, 1); // blink LED every second

    6.     BLE& ble = BLE::Instance(BLE::DEFAULT_INSTANCE);
    7.     ble.init(bleInitComplete);

    8.     /* SpinWait for initialization to complete. This is necessary because the
    9.      * BLE object is used in the main loop below. */
    10.     while (ble.hasInitialized()  == false) { /* spin loop */ }

    11.     // infinite loop
    12.     while (1) {
    13.         // check for trigger from periodicCallback()
    14.         if (triggerSensorPolling && ble.getGapState().connected) {
    15.             triggerSensorPolling = false;

    16.             // Do blocking calls or whatever is necessary for sensor polling.
    17.             // In our case, we simply update the HRM measurement.
    18.             hrmCounter++;
    19.             if (hrmCounter == 175) { //  100 <= HRM bps <=175
    20.                 hrmCounter = 100;
    21.             }

    22.             hrService->updateHeartRate(hrmCounter);
    23.         } else {
    24.             ble.waitForEvent(); // low power wait for event
    25.         }
    26.     }
    27. }
    复制代码
    我把两个文件都编译下载进开发板,手机选择“linksprite”连接后显示如下问题“the devices don't require services”,后就自动退出连接,HRM心跳检测没能显示
    Screenshot_2016-04-17-16-57-37.jpeg 20160417_170837.jpg
    其中评测文章程序开发板显示如下
    IMG_20160417_173955.jpg IMG_20160417_174000.jpg


    回复

    使用道具 举报

  • TA的每日心情
    开心
    2020-2-14 12:16
  • 签到天数: 827 天

    连续签到: 1 天

    [LV.10]以坛为家III

     楼主| 发表于 2016-4-17 21:43:11 | 显示全部楼层
    之前LED是粉色,现在是红色,也算是一个发现
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /2 下一条



    手机版|小黑屋|与非网

    GMT+8, 2024-4-26 14:39 , Processed in 0.118065 second(s), 18 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.