UCLA CSM119 "How to Approach New Hardware Demo"

Dependencies:   MAX30101

Files at this revision

API Documentation at this revision

Comitter:
xihan94
Date:
Fri Jun 01 23:23:08 2018 +0000
Parent:
1:ad1b075585bc
Commit message:
Update

Changed in this revision

MAX30101.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r ad1b075585bc -r 2e12e0cd1f26 MAX30101.lib
--- a/MAX30101.lib	Fri Jun 01 10:05:51 2018 +0000
+++ b/MAX30101.lib	Fri Jun 01 23:23:08 2018 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/teams/MaximIntegrated/code/MAX30101/#e7a4b17cd918
+https://os.mbed.com/teams/MaximIntegrated/code/MAX30101/#85513b7480f5
diff -r ad1b075585bc -r 2e12e0cd1f26 main.cpp
--- a/main.cpp	Fri Jun 01 10:05:51 2018 +0000
+++ b/main.cpp	Fri Jun 01 23:23:08 2018 +0000
@@ -22,10 +22,10 @@
     
     MAX30101::InterruptBitField_u interruptStatus;
     hr.getInterruptStatus(interruptStatus);
-    printf("Interrupt Status: 0x%02x\r\n", interruptStatus.all);
+//    printf("Interrupt Status: 0x%02x\r\n", interruptStatus.all);
     
     if (interruptStatus.bits.pwr_rdy == 0x1) {
-        printf("Powered on\r\n");
+//        printf("Powered on\r\n");
         
         // Soft reset
         MAX30101::ModeConfiguration_u modeConf;
@@ -37,12 +37,12 @@
         // Configure FIFO
         MAX30101::FIFO_Configuration_u fifoConf;
         hr.getFIFOConfiguration(fifoConf);
-        pc.printf("FIFO Configuration: 0x%02x\r\n", fifoConf.all);
+//        pc.printf("FIFO Configuration: 0x%02x\r\n", fifoConf.all);
           
         // Set LED power
         hr.setLEDPulseAmplitude(MAX30101::LED1_PA, 0x0C);
         hr.setLEDPulseAmplitude(MAX30101::ProxModeLED_PA, 0x19);
-        pc.printf("LED set\r\n");
+//        pc.printf("LED set\r\n");
         
         MAX30101::SpO2Configuration_u spo2Conf;
         hr.getSpO2Configuration(spo2Conf);
@@ -50,7 +50,7 @@
         spo2Conf.bits.spo2_sr = MAX30101::SR_100_Hz;
         hr.setSpO2Configuration(spo2Conf);
         hr.getSpO2Configuration(spo2Conf);
-        pc.printf("SpO2 Configuration: 0x%02x\r\n", spo2Conf.all);
+//        pc.printf("SpO2 Configuration: 0x%02x\r\n", spo2Conf.all);
         
         // Proximity settings
         hr.setProxIntThreshold(0x14);
@@ -59,20 +59,20 @@
         modeConf.all = 0;
         modeConf.bits.mode = MAX30101::HeartRateMode;
         hr.setModeConfiguration(modeConf);
-        printf("Mode set\r\n");
+//        printf("Mode set\r\n");
     }
     
     if (interruptStatus.bits.prox_int == 0x1) {
-        printf("Proximity Triggered, entered HR Mode.");
+//        printf("Proximity Triggered, entered HR Mode.");
     }
     
     if (interruptStatus.bits.ppg_rdy == 0x1) {
-        printf("PPG Ready.\r\n");
+//        printf("PPG Ready.\r\n");
         mask_ppg = 1;
     }
     
     if (interruptStatus.bits.a_full == 0x1) {
-        printf("FIFO Almost Full.\r\n");
+//        printf("FIFO Almost Full.\r\n");
         uint8_t data[FIFO_DATA_MAX];
         uint16_t readBytes = 0;
         hr.readFIFO(MAX30101::OneLedChannel, data, readBytes);
@@ -100,7 +100,7 @@
 
 // main() runs in its own thread in the OS
 int main() {
-    printf("Hello world.\r\n");
+//    printf("Hello world.\r\n");
     
     t.start(callback(&evqueue, &EventQueue::dispatch_forever));