欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 3230|回復: 4
打印 上一主題 下一主題
收起左側

求教max30100在網上找的Arduino代碼不行

[復制鏈接]
跳轉到指定樓層
#
幫忙看下哪里有問題(在網上找的代碼),運行后燈不亮,串口只顯示Beat



#include <Wire.h>
#include "MAX30100_PulseOximeter.h"

#define REPORTING_PERIOD_MS     1000

// PulseOximeter is the higher level interface to the sensor
// it offers:
//  * beat detection reporting
//  * heart rate calculation
//  * SpO2 (oxidation level) calculation
PulseOximeter pox;

uint32_t tsLastReport = 0;

// Callback (registered below) fired when a pulse is detected
void onBeatDetected()
{
    Serial.println("Beat!");
}

void setup()
{
    Serial.begin(115200);

    // Initialize the PulseOximeter instance and register a beat-detected callback
    pox.begin();
    pox.setOnBeatDetectedCallback(onBeatDetected);
}

void loop()
{
    // Make sure to call update as fast as possible
    pox.update();

    // Asynchronously dump heart rate and oxidation levels to the serial
    // For both, a value of 0 means "invalid"
    if (millis() - tsLastReport > REPORTING_PERIOD_MS) {
        Serial.print("Heart rate:");
        Serial.print(pox.getHeartRate());
        Serial.print("bpm / SpO2:");
        Serial.print(pox.getSpO2());
        Serial.println("%");

        tsLastReport = millis();
    }
}

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

地板
ID:750420 發表于 2020-10-20 19:20 | 只看該作者
解決了,參考這篇博文https://blog.csdn.net/JaLLs/article/details/99708019,包括需要下載的zip庫都有再評論區給你
回復

使用道具 舉報

板凳
ID:712072 發表于 2020-7-15 09:15 | 只看該作者
請問你解決了嗎?我也碰到了這個問題
回復

使用道具 舉報

沙發
ID:712072 發表于 2020-7-15 09:14 | 只看該作者
請問你解決了嗎?我也碰到了同樣的問題
回復

使用道具 舉報

樓主
ID:528780 發表于 2019-5-6 17:32 | 只看該作者
我用30102也遇到同樣問題
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表