HRV -> Mood

Dependencies:   MAX30101 Hexi_KW40Z Hexi_OLED_SSD1351

Revision:
19:f9f76e6d0c68
Parent:
18:0d1ef7ea9d4b
Child:
20:d62cec0a0f5c
--- a/8cee5929f4d8/main.cpp	Mon Mar 18 02:19:36 2019 +0000
+++ b/8cee5929f4d8/main.cpp	Mon Mar 18 16:42:54 2019 +0000
@@ -51,7 +51,7 @@
 char text[20];  /* Text Buffer */
 
 // I added this
-const int num_samples = 500; // for 30 sec
+const int num_samples = 500; // for 5 sec
 int ppg[num_samples];
 int SDNN, valence_arousal;
 double HF_LF = 0.0;
@@ -518,7 +518,7 @@
     strcpy((char *) text, "Raw PPG:");
     oled.Label((uint8_t *)text,7,0);
 
-    strcpy((char *) text, "           LOFI");
+    strcpy((char *) text, "         LOFI");
     oled.Label((uint8_t *)text,7,40);
     //dynamic text setup
     textProperties.fontColor = COLOR_WHITE;
@@ -527,8 +527,26 @@
 
     txThread.start(txTask);
     
+    // added below
     
+    /* Change font color to Blue */ 
+    textProperties.fontColor   = COLOR_BLUE;
+    oled.SetTextProperties(&textProperties);
     
+    /* Display Bluetooth Label at x=17,y=65 */ 
+    strcpy((char *) text,"BLUETOOTH");
+    oled.Label((uint8_t *)text,17,65);
+    
+    /* Change font color to white */ 
+    textProperties.fontColor   = COLOR_WHITE;
+    textProperties.alignParam = OLED_TEXT_ALIGN_CENTER;
+    oled.SetTextProperties(&textProperties);
+    
+    /* Display Label at x=22,y=80 */ 
+    strcpy((char *) text,"Tap to turn OFF");
+    oled.Label((uint8_t *)text,7,80);
+    
+    // added above
     
     while (true) {
 
@@ -549,6 +567,9 @@
             // Display time reading in 35px by 15px textbox at(x=55, y=40) 
             oled.TextBox((uint8_t *)text,55,55,35,15);
         }*/
+        
+        blueLed = !kw40z_device.GetAdvertisementMode();  // added this
+        
         Thread::wait(1000);
     }
     return 0;