The HexiHeart is a demo project product that takes advantage of many of the onboard Hexiwear sensors and capabilities to create a multifunctional fitness and safety watch.

Dependencies:   FXAS21002 FXOS8700 Hexi_KW40Z Hexi_OLED_SSD1351 MAXIM W25Q64FVSSIG HTU21D MPL3115A2 TSL2561

Fork of HexiHeart_Alex by Hexiwear_zeta

Files at this revision

API Documentation at this revision

Comitter:
asong
Date:
Fri Apr 13 00:10:22 2018 +0000
Parent:
16:537ef0c72084
Child:
18:1f28eca85e3f
Commit message:
Optimized some heart rate displays

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Apr 12 22:18:24 2018 +0000
+++ b/main.cpp	Fri Apr 13 00:10:22 2018 +0000
@@ -2087,6 +2087,8 @@
         }
         case 29: { //Zone Boundary Info
             oled.FillScreen(COLOR_BLACK);
+            textProperties.fontColor = COLOR_WHITE; //Change font to yellow
+            oled.SetTextProperties(&textProperties);//Implement color change
             oled.Label((uint8_t *)"HR Zone Info", 10, 5);// Display at x,y
             textProperties.fontColor = COLOR_YELLOW; //Change font to yellow
             oled.SetTextProperties(&textProperties);//Implement color change
@@ -4285,7 +4287,7 @@
                 textProperties.fontColor = COLOR_RED; // is impact detected? 
             }       
             oled.SetTextProperties(&textProperties); 
-            oled.Label((uint8_t *)"FAP",3,0);  //Display "FAP" at x,y
+            oled.Label((uint8_t *)"AFP",3,0);  //Display "AFP" at x,y
             textProperties.fontColor = COLOR_WHITE;
             oled.SetTextProperties(&textProperties);
             
@@ -4331,7 +4333,66 @@
             fall_det_end(); 
             }
             break;
-        }//end case 21       
+        }//end case 21 
+        case 31: {
+            sprintf(display_buff, "%u", Heart_Rate); // Convert int to char to display
+            textProperties.fontColor = COLOR_RED;
+            oled.SetTextProperties(&textProperties);
+            oled.Label((uint8_t *)display_buff, 40, 25);
+            if(Current_Zone == 1) {
+                textProperties.fontColor = COLOR_YELLOW;
+                oled.SetTextProperties(&textProperties);
+            } else if(Current_Zone == 2) {
+                textProperties.fontColor = COLOR_BLUE;
+                oled.SetTextProperties(&textProperties);
+            } else if(Current_Zone == 3) {
+                textProperties.fontColor = COLOR_GREEN;
+                oled.SetTextProperties(&textProperties);
+            } else if(Current_Zone == 4) {
+                textProperties.fontColor = COLOR_RED;
+                oled.SetTextProperties(&textProperties);
+            }
+            sprintf(display_buff, "%u", Current_Zone); // Convert int to char to display
+            oled.Label((uint8_t *)display_buff, 71, 45);
+            if(Prev_Zone == 1) {
+                textProperties.fontColor = COLOR_YELLOW;
+                oled.SetTextProperties(&textProperties);
+            } else if(Prev_Zone == 2) {
+                textProperties.fontColor = COLOR_BLUE;
+                oled.SetTextProperties(&textProperties);
+            } else if(Prev_Zone == 3) {
+                textProperties.fontColor = COLOR_GREEN;
+                oled.SetTextProperties(&textProperties);
+            } else if(Prev_Zone == 4) {
+                textProperties.fontColor = COLOR_RED;
+                oled.SetTextProperties(&textProperties);
+            }
+            sprintf(display_buff, "%u", Prev_Zone); // Convert int to char to display
+            oled.Label((uint8_t *)display_buff, 71, 60);
+            textProperties.fontColor = COLOR_WHITE; //Change font to white
+            oled.SetTextProperties(&textProperties);//Implement color change
+            break;   
+        }   
+        case 33: {
+            sprintf(display_buff, "%u", Heart_Rate); // Convert int to char to display
+            if(Current_Zone == 1) {
+                textProperties.fontColor = COLOR_YELLOW;
+                oled.SetTextProperties(&textProperties);
+            } else if(Current_Zone == 2) {
+                textProperties.fontColor = COLOR_BLUE;
+                oled.SetTextProperties(&textProperties);
+            } else if(Current_Zone == 3) {
+                textProperties.fontColor = COLOR_GREEN;
+                oled.SetTextProperties(&textProperties);
+            } else if(Current_Zone == 4) {
+                textProperties.fontColor = COLOR_RED;
+                oled.SetTextProperties(&textProperties);
+            }
+            oled.Label((uint8_t *)display_buff, 35, 40);// Display at x,y
+            textProperties.fontColor = COLOR_WHITE; 
+            oled.SetTextProperties(&textProperties);  
+            break;       
+        }   
         case 72: {// BlueTooth on/off
             textProperties.fontColor = COLOR_WHITE;
             oled.SetTextProperties(&textProperties);