MAX30100 pulse rate sensor

Dependencies:   PulseRate

Dependents:   PulseRate

Revision:
2:d329886938f1
Parent:
0:faf977308bdc
Child:
3:fa37b0c705b3
--- a/main.cpp	Fri Aug 18 02:58:06 2017 +0000
+++ b/main.cpp	Wed Aug 23 19:04:51 2017 +0000
@@ -1,6 +1,36 @@
 #include "mbed.h"
 #include "MAX30100.h"
 
+DigitalOut led(LED1);
+
+Serial pc(USBTX, USBRX); // tx, rx
+
+MAX30100 max;
+
 int main() {
+    max.begin(pw1600, i50, sr100);
+    max.setLEDs(pw1600, i27, i50);
+    
+    int partID = max.getPartID();
+    
+    if(partID == POR_PART_ID){
+        pc.printf("MAX30100 is online...\n\r");    
+    }
+    
+    else{
+        pc.printf("MAX30100 is offline...\n\r");
+        pc.printf("Value is %d\n\r",partID);
+        pc.printf("Should be %d\n\r",POR_PART_ID);
+        while(1){
+            wait(1);
+        }
+    }
+    
+    int revID = max.getRevID();
+    
+    pc.printf("RevID is %d\n\r",revID);
+    
+    //max.setLEDs(pw1600, i50, i14);
+    
 return 1;
 }