Changes done in ECG and BT

Dependencies:   SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217

Fork of merged_code2_20sept_2017_4th_oct_2017 by nikita teggi

Files at this revision

API Documentation at this revision

Comitter:
nikitateggi
Date:
Mon Jan 30 10:57:38 2017 +0000
Parent:
1:8316c23ec6b9
Child:
3:9a06c2bed650
Commit message:
POC code modified

Changed in this revision

TFTLCD_8bit.lib Show annotated file Show diff for this revision Revisions of this file
display_modules.cpp Show annotated file Show diff for this revision Revisions of this file
glc.cpp 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
sdcard.cpp Show annotated file Show diff for this revision Revisions of this file
sdcard.h Show annotated file Show diff for this revision Revisions of this file
--- a/TFTLCD_8bit.lib	Mon Jan 30 07:45:41 2017 +0000
+++ b/TFTLCD_8bit.lib	Mon Jan 30 10:57:38 2017 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/ThihaElectronics/code/TFTLCD_8bit/#155abe4126e3
+https://developer.mbed.org/teams/SenseSemi/code/TFTLCD_8bit/#bfc5689f9d8f
--- a/display_modules.cpp	Mon Jan 30 07:45:41 2017 +0000
+++ b/display_modules.cpp	Mon Jan 30 10:57:38 2017 +0000
@@ -98,8 +98,8 @@
  void screen_ecg_2()
    {
         DisableTouch();  
-            // lcd.FillRect(5,90,230,320,COLOR_BLACK); 
-            // lcd.Print( "DONE", CENTER, 95);
+             lcd.FillRect(5,90,230,320,COLOR_BLACK); 
+             lcd.Print( "DONE", CENTER, 95);
              lcd.FillRoundRect(60,230,180,300,COLOR_GREEN);
              lcd.Print( "RET",100,250,COLOR_BLACK,COLOR_GREEN,0);
         EnableTouch();
@@ -150,6 +150,7 @@
                 lcd.Print( tim1,120,120,COLOR_YELLOW,COLOR_BLACK, 0);
                         
             }
+            lcd.Print( "Tst in Progres",3,150,COLOR_GREEN,COLOR_BLACK,0);
         EnableTouch();
   }                
   
@@ -209,6 +210,6 @@
     DisableTouch();
     lcd.FillRect(5,127,230,320,COLOR_BLACK); 
      char buf[10];
-     sprintf (buf, "BG is %d mgdl",mgdl);
+     sprintf (buf, "BG is %d mg/dl",mgdl);
      lcd.Print( buf, 5,100,COLOR_YELLOW,COLOR_BLACK, 0);
    }
\ No newline at end of file
--- a/glc.cpp	Mon Jan 30 07:45:41 2017 +0000
+++ b/glc.cpp	Mon Jan 30 10:57:38 2017 +0000
@@ -80,7 +80,7 @@
    
         sd_write(mgdl);
         sd_close();
-        ble.printf("blood glucose is %d", mgdl);
+        ble.printf("blood glucose is %d mg/dl", mgdl);
         flipper.detach();
         flipper1.detach();
       //  return mgdl;
--- a/main.cpp	Mon Jan 30 07:45:41 2017 +0000
+++ b/main.cpp	Mon Jan 30 10:57:38 2017 +0000
@@ -147,9 +147,9 @@
               {
                 pid=pid+1; 
                 screen_main_2(pid);
-                sd_open_GLCfile(pid);
+                sd_open_GLCfilee(pid);
                  sd_close();
-                 sd_open_ECGfile(pid);
+                 sd_open_ECGfilee(pid);
                  sd_close();
                  sd_open_BPfile(pid);
                  sd_close();
--- a/sdcard.cpp	Mon Jan 30 07:45:41 2017 +0000
+++ b/sdcard.cpp	Mon Jan 30 10:57:38 2017 +0000
@@ -17,13 +17,27 @@
   epoch_time1=rtc_read();
  // strftime(buffer, 32, "GLC_%s", pid);
   
- sprintf(buffer1,"/sd/GLC_%d.csv",pid);
+ sprintf(buffer1,"/sd/%d_GLC.csv",pid);
   fp = fopen(buffer1,"a"); 
   fprintf(fp,"%s\n",ctime(&epoch_time1) );
   
  
  }   
+  void sd_open_GLCfilee(int pid)
+ {
+     
+  char buffer[32];
+  char buffer1[32];
+  time_t  epoch_time1;
+  epoch_time1=rtc_read();
+ // strftime(buffer, 32, "GLC_%s", pid);
+  
+ sprintf(buffer1,"/sd/%d_GLC.csv",pid);
+  fp = fopen(buffer1,"a"); 
+   fprintf(fp,"PATIENT ID %d\n",pid);
+  
  
+ } 
   void sd_open_ECGfile(int pid)
  {
      
@@ -33,13 +47,28 @@
   epoch_time1=rtc_read();
   // strftime(buffer, 32, "ECG_%d", pid);
   
-  sprintf(buffer1,"/sd/ECG_%d.csv",pid);
+  sprintf(buffer1,"/sd/%d_ECG.csv",pid);
   fp = fopen(buffer1,"a"); 
   fprintf(fp,"%s\n",ctime(&epoch_time1) );
  // strftime(buffer, 32, "ECG_%d-%m-%Y_%H_%M",localtime(&epoch_time1));
  //  fprintf(fp,"%d\n",buffer ); 
  } 
  
+  void sd_open_ECGfilee(int pid)
+ {
+     
+ // char buffer[32];
+  char buffer1[32];
+  time_t  epoch_time1;
+  epoch_time1=rtc_read();
+  // strftime(buffer, 32, "ECG_%d", pid);
+  
+  sprintf(buffer1,"/sd/%d_ECG.csv",pid);
+  fp = fopen(buffer1,"a"); 
+  fprintf(fp,"PATIENT ID %d\n",pid );
+ // strftime(buffer, 32, "ECG_%d-%m-%Y_%H_%M",localtime(&epoch_time1));
+ //  fprintf(fp,"%d\n",buffer ); 
+ } 
   void sd_open_BPfile(int pid)
  {
      
@@ -49,7 +78,7 @@
   epoch_time1=rtc_read();
   // strftime(buffer, 32, "ECG_%d", pid);
   
-  sprintf(buffer1,"/sd/BP_%d.csv",pid);
+  sprintf(buffer1,"/sd/%d_BP.csv",pid);
   fp = fopen(buffer1,"a"); 
   fprintf(fp,"%s\n",ctime(&epoch_time1) );
  } 
--- a/sdcard.h	Mon Jan 30 07:45:41 2017 +0000
+++ b/sdcard.h	Mon Jan 30 10:57:38 2017 +0000
@@ -2,7 +2,9 @@
 #define SDCARD_H_
 
 void sd_open_ECGfile(int pid);
+void sd_open_ECGfilee(int pid);
 void sd_open_GLCfile(int pid);
+void sd_open_GLCfilee(int pid);
 void sd_open_BPfile(int pid);
 void sd_write (int value);
 void sd_close();