#include <Wire.h>
#include <MAX30100_PulseOximeter.h>
#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(10, 11); //RX, TX
#define BLYNK_SERIAL DebugSerial
#include <BlynkSimpleStream.h>
//Auth
char auth[] = "66c8a1cf6ab64769889e1daf37aefb82";
//widget virtual pin goes here
WidgetLCD lcd(V5);
//default waiting period
#define REPORTING_PERIOD_MS 1000
//Instantiate pulser oximeter
PulseOximeter pox;
uint32_t tsLastReport = 0;
void setup()
{
DebugSerial.begin(19200);
Serial.begin(9600);
Blynk.begin(Serial,auth); //Session begins here
pox.begin();
}
void loop()
{
Blynk.run();
pox.update();
//lcd.clear();
//lcd.print(0,0 ,"Heart Rate:");
//timer.run();
//Asyn data push
if (millis() - tsLastReport > REPORTING_PERIOD_MS)
{
lcd.print(0, 0, "Heart Rate:");
lcd.print(0,1 ,pox.getHeartRate());
tsLastReport = millis();
}
}
Comments