久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索

基于stc89c52的心率測試程序

查看數: 5298 | 評論數: 2 | 收藏 2
關燈 | 提示:支持鍵盤翻頁<-左 右->
    組圖打開中,請稍候......
發(fā)布時間: 2017-5-29 11:02

正文摘要:

基于stc89c52的心率測試程序

回復

ID:695384 發(fā)表于 2020-6-15 10:00
MAX30102測心率血氧飽和度的代碼

#include <Wire.h>
#include "MAX30105.h"
#include "spo2_algorithm.h"

MAX30105 particleSensor;

#define MAX_BRIGHTNESS 255

#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)
//Arduino Uno doesn't have enough SRAM to store 100 samples of IR led data and red led data in 32-bit format
//To solve this problem, 16-bit MSB of the sampled data will be truncated. Samples become 16-bit data.
uint16_t irBuffer[100]; //infrared LED sensor data
uint16_t redBuffer[100]; //red LED sensor data
#else
uint32_t irBuffer[100]; //infrared LED sensor data
uint32_t redBuffer[100]; //red LED sensor data
#endif

int32_t bufferLength; //data length
int32_t spo2; //SPO2 value
int8_t validSPO2; //indicator to show if the SPO2 calculation is valid
int32_t heartRate; //heart rate value
int8_t validHeartRate; //indicator to show if the heart rate calculation is valid

byte pulseLED = 11; //Must be on PWM pin
byte readLED = 13; //Blinks with each data read

void setup()
{
Serial.begin(115200); // initialize serial communication at 115200 bits per second:

pinMode(pulseLED, OUTPUT);
pinMode(readLED, OUTPUT);

// Initialize sensor
if (!particleSensor.begin(Wire, I2C_SPEED_FAST)) //Use default I2C port, 400kHz speed
{
Serial.println(F("MAX30105 was not found. Please check wiring/power."));
while (1);
}

Serial.println(F("Attach sensor to finger with rubber band. Press any key to start conversion"));
while (Serial.available() == 0) ; //wait until user presses a key
Serial.read();

byte ledBrightness = 60; //Options: 0=Off to 255=50mA
byte sampleAverage = 4; //Options: 1, 2, 4, 8, 16, 32
byte ledMode = 2; //Options: 1 = Red only, 2 = Red + IR, 3 = Red + IR + Green
byte sampleRate = 100; //Options: 50, 100, 200, 400, 800, 1000, 1600, 3200
int pulseWidth = 411; //Options: 69, 118, 215, 411
int adcRange = 4096; //Options: 2048, 4096, 8192, 16384

particleSensor.setup(ledBrightness, sampleAverage, ledMode, sampleRate, pulseWidth, adcRange); //Configure sensor with these settings
}

void loop()
{
bufferLength = 100; //buffer length of 100 stores 4 seconds of samples running at 25sps

//read the first 100 samples, and determine the signal range
for (byte i = 0 ; i < bufferLength ; i++)
{
while (particleSensor.available() == false) //do we have new data?
particleSensor.check(); //Check the sensor for new data
ID:778798 發(fā)表于 2020-6-14 11:01
感謝樓主分享

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

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 一级黄色淫片 | 欧美精品在线一区 | 亚洲免费高清 | 久久久久国产精品一区二区 | 成人av高清在线观看 | 一区二区在线 | 中文字幕在线一区 | 亚洲欧美中文日韩在线v日本 | av国产精品毛片一区二区小说 | 精品一区电影 | 免费视频一区二区 | 午夜成人免费视频 | 久热爱| 久久激情视频 | 国产精品mv在线观看 | 91在线电影 | 精品乱码久久久久 | 精品久久香蕉国产线看观看亚洲 | 国产精品日本一区二区在线播放 | 天堂色区 | 香蕉久久a毛片 | 色欧美片视频在线观看 | 国产精品乱码一区二区三区 | 中文字幕不卡在线88 | 亚洲精品一| 国产精品久久国产精品 | 特级做a爱片免费69 精品国产鲁一鲁一区二区张丽 | 亚州成人| 免费二区| 在线日韩不卡 | 精品国产乱码久久久久久蜜臀 | 欧美色综合一区二区三区 | 91pron在线| 久久精品视频亚洲 | 红色av社区 | 日韩欧美国产精品 | 国产小视频在线观看 | 亚洲欧美中文日韩在线v日本 | 日韩久久久久久久久久久 | 国产ts人妖一区二区三区 | 中文字幕日韩一区 |