1805|2

98

帖子

0

TA的资源

一粒金砂(中级)

楼主
 

大赛分享四:RSL10蓝牙SoC之BME680传感器数据采集 [复制链接]

 

设备:

RSL10-SENSE-GEVK:RSL10 传感器开发套件

 

该传感器的数据采集有例程,直接上修改后的代码

//-----------------------------------------------------------------------------
// Copyright (c) 2018 Semiconductor Components Industries LLC
// (d/b/a "ON Semiconductor").  All rights reserved.
// This software and/or documentation is licensed by ON Semiconductor under
// limited terms and conditions.  The terms and conditions pertaining to the
// software and/or documentation are available at
// http://www.onsemi.com/site/pdf/ONSEMI_T&C.pdf ("ON Semiconductor Standard
// Terms and Conditions of Sale, Section 8 Software") and if applicable the
// software license agreement.  Do not use this software and/or documentation
// unless you have carefully read and you agree to the limited terms and
// conditions.  By using this software and/or documentation, you agree to the
// limited terms and conditions.
//-----------------------------------------------------------------------------
#include <stdio.h>
#include <BDK.h>
#include <BSP_Components.h>
#include <BLE_Components.h>
#include <SoftwareTimer.h>
#include <bsec_integration.h>

#define DATA_LEN 36
struct SwTimer bsec_timer;
bsec_env_process_struct bsec_process_params = APP_BSEC_PROCESS_STRUCT_VALUE;



int main(void)
{
    BDK_Initialize();
    printf("\r\nAPP: BME680_BSEC example.\r\n");

    /* Clear saved BSEC state if button is pressed after reset. */
    {
        I2CEeprom m24rf64;
        uint8_t buffer[APP_BSEC_EEPROM_MAGIC_SIZE] = { 0 };

        I2CEeprom_Initialize(APP_BSEC_EEPROM_I2C_ADDR,
                APP_BSEC_EEPROM_PAGE_SIZE, &m24rf64);

        I2CEeprom_Write(APP_BSEC_EEPROM_ADDR, buffer,
                APP_BSEC_EEPROM_MAGIC_SIZE, &m24rf64);

        printf("APP: Deleted saved BSEC state.\r\n");
    }

    /* Initialize BSEC library */
    {
        bsec_env_return_val retval;
        bsec_env_init_struct bsec_init_params = APP_BSEC_INIT_STRUCT_VALUE;

        retval = BSEC_ENV_Initialize(&bsec_init_params);

        ASSERT_DEBUG(retval.bme680_status == BME680_OK);
        ASSERT_DEBUG(retval.bsec_status == BSEC_OK);
    }

    SwTimer_Initialize(&bsec_timer);
    SwTimer_ExpireInMs(&bsec_timer, 1);

    printf("APP: Entering main loop.\r\n");
    while (1)
    {
        /* Execute any events that occurred and refresh Watchdog. */
        BDK_Schedule();

        if (SwTimer_IsExpired(&bsec_timer) == true)
        {
            int64_t next_call;

            next_call = BSEC_ENV_Process(&bsec_process_params);

            SwTimer_ExpireInMs(&bsec_timer, next_call);

            printf("BSEC: Next process call in: %lu ms.\r\n",
                    (uint32_t) next_call);
        }

        SYS_WAIT_FOR_INTERRUPT;
    }

    return 0;
}

结果打印日志:

iaq = 25 空气质量

temperature = 30.89 温度

humidity = 70.76% 湿度

raw_pressure = 100067.000000Pa 气压

co2_equivalent = 500.00 ppm 二氧化碳浓度

breath_voc_equivalent = 0.50 ppm

最新回复

结果应该很精确吧 测试的可以   详情 回复 发表于 2021-6-14 10:47
点赞 关注
 
 

回复
举报

6628

帖子

0

TA的资源

五彩晶圆(高级)

沙发
 

结果应该很精确吧

测试的可以

 
 
 

回复

98

帖子

0

TA的资源

一粒金砂(中级)

板凳
 

精确度确实很高  非常棒的传感器

 
 
 

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

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/10 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表