@@ -93,23 +93,6 @@ void setup()
9393 hat.writeLEDCurrent (1 , 0x1F ); // IR if (A), Red if (B)
9494 hat.startPeriodicMeasurement ();
9595 }
96-
97- #if 0
98- uint8_t v{};
99- hat.readRegister8((uint8_t)0x09, v, 0, false);
100- M5_LOGI("Mode:%X", v);
101- hat.readRegister8((uint8_t)0x0A, v, 0, false);
102- M5_LOGI("SpO2:%X", v);
103- hat.readRegister8((uint8_t)0x08, v, 0, false);
104- M5_LOGI("FIFO:%X", v);
105- hat.readRegister8((uint8_t)0x0C, v, 0, false);
106- M5_LOGI("LED1:%X", v);
107- hat.readRegister8((uint8_t)0x0D, v, 0, false);
108- M5_LOGI("LED2:%X", v);
109- hat.readRegister8((uint8_t)0x11, v, 0, false);
110- M5_LOGI("SLOT12:%X", v);
111- #endif
112-
11396 lcd.clear (TFT_DARKGREEN);
11497
11598 monitor.setSamplingRate (hat.caluculateSamplingRate ());
@@ -130,21 +113,21 @@ void loop()
130113 bool beat{};
131114 // MAX30102 is equipped with a FIFO, so multiple data may be stored
132115 while (hat.available ()) {
133- M5.Log .printf (" \n >IR:%u\n >RED:%u" , hat.ir (), hat.red ());
116+ M5.Log .printf (" >IR:%u\n >RED:%u\n " , hat.ir (), hat.red ());
134117 monitor.push_back (hat.ir (), hat.red ()); // Push back the oldest data
135- M5.Log .printf (" \n >MIR:%f" , monitor.latestIR ());
118+ M5.Log .printf (" >MIR:%f\n " , monitor.latestIR ());
136119 monitor.update ();
137120 beat |= monitor.isBeat ();
138121 hat.discard (); // Discard the oldest data
139122 }
140- M5.Log .printf (" \n >BPM:%f\n >SpO2:%f\n >BEAT:%u\n " , monitor.bpm (), monitor.SpO2 (), beat);
123+ M5.Log .printf (" >BPM:%f\n >SpO2:%f\n >BEAT:%u\n " , monitor.bpm (), monitor.SpO2 (), beat);
141124 }
142125
143126 // Measure tempeature
144127 if (M5.BtnA .wasClicked ()) {
145128 TemperatureData td{};
146129 if (hat.measureTemperatureSingleshot (td)) {
147- M5.Log .printf (" \n >Temp:%f" , td.celsius ());
130+ M5.Log .printf (" >Temp:%f\n " , td.celsius ());
148131 }
149132 }
150133}
0 commit comments