Skip to content

Commit

Permalink
cpp file corrected, ino file modified
Browse files Browse the repository at this point in the history
  • Loading branch information
MishalJasmine committed Dec 16, 2024
1 parent 0c88cf4 commit e428702
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@
//
// For information on how to use, visit https://github.com/Protocentral/protocentral_max30001
//

/////////////////////////////////////////////////////////////////////////////////////////

#include <SPI.h>
#include "protocentral_max30001.h"

#define MAX30001_CS_PIN 17
#define MAX30001_CS_PIN 7 // change this to 5 if using ESP32
#define MAX30001_DELAY_SAMPLES 8 // Time between consecutive samples

#define CES_CMDIF_PKT_START_1 0x0A
Expand All @@ -48,11 +47,12 @@ volatile char DataPacket[DATA_LEN];
const char DataPacketFooter[2] = {ZERO, CES_CMDIF_PKT_STOP};
const char DataPacketHeader[5] = {CES_CMDIF_PKT_START_1, CES_CMDIF_PKT_START_2, DATA_LEN, ZERO, CES_CMDIF_TYPE_DATA};

uint8_t data_len = 0x0C;

MAX30001 max30001(MAX30001_CS_PIN);

signed long ecg_data;
signed long bioz_data;
bool BioZSkipSample = false;

void sendData(signed long ecg_sample, signed long bioz_sample, bool _bioZSkipSample)
{
Expand Down Expand Up @@ -99,6 +99,8 @@ void sendData(signed long ecg_sample, signed long bioz_sample, bool _bioZSkipSam
}
}

bool BioZSkipSample = false;

void setup()
{
Serial.begin(57600); // Serial begin
Expand Down Expand Up @@ -142,4 +144,4 @@ void loop()
BioZSkipSample = false;
}
delay(MAX30001_DELAY_SAMPLES);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
//
// Arduino connections:
//
// |MAX30001 pin label| Pin Function |Arduino Connection|ESP32 Connection|
// |----------------- |:--------------------:|-----------------:|---------------:|
// | MISO | Slave Out | D12 | 19 |
// | MOSI | Slave In | D11 | 23 |
// | SCLK | Serial Clock | D13 | 18 |
// | CS | Chip Select | D7 | 5 |
// | VCC | Digital VDD | +5V | +5V |
// | GND | Digital Gnd | Gnd | Gnd |
// | FCLK | 32K CLOCK | - | - |
// | INT1 | Interrupt1 | 02 | 02 |
// | INT2 | Interrupt2 | - | - |
// |MAX30001 pin label| Pin Function |Arduino Connection|
// |----------------- |:--------------------:|-----------------:|
// | MISO | Slave Out | D12 |
// | MOSI | Slave In | D11 |
// | SCLK | Serial Clock | D13 |
// | CS | Chip Select | D7 |
// | VCC | Digital VDD | +5V |
// | GND | Digital Gnd | Gnd |
// | FCLK | 32K CLOCK | - |
// | INT1 | Interrupt1 | 02 |
// | INT2 | Interrupt2 | - |
//
// This software is licensed under the MIT License(http://opensource.org/licenses/MIT).
//
Expand Down Expand Up @@ -150,4 +150,4 @@ void loop()
BioZSkipSample = false;
}
delay(8);
}
}
3 changes: 1 addition & 2 deletions src/protocentral_max30001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void MAX30001::BeginECGBioZ()
cnfg_bioz.bit.dlpf = 0x01;
cnfg_bioz.bit.fcgen = 0b0100;
cnfg_bioz.bit.cgmon = 0x00;
cnfg_bioz.bit.cgmag = 0b100;
cnfg_bioz.bit.cgmag = 0b010;
cnfg_bioz.bit.phoff = 0x0011;

// BioZ MUX Settings
Expand Down Expand Up @@ -365,7 +365,6 @@ signed long MAX30001::getBioZSamples(void)
return sbioztemp;
}


void MAX30001::getHRandRR(void)
{
uint8_t regReadBuff[4];
Expand Down

0 comments on commit e428702

Please sign in to comment.