export test

Dependencies:   SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217

Fork of Int_Demo_09May2017_Suhasini_HRavg_Nikita_ili9341 by nikita teggi

Committer:
nikitateggi
Date:
Sat Jun 17 09:36:18 2017 +0000
Revision:
20:7c64e6ecad76
Parent:
15:208b146151ba
Child:
21:7ef1b0b40841
poc code with finger detect and leadoff

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nikitateggi 0:c47fb0c1bbf6 1 #include "mbed.h"
nikitateggi 0:c47fb0c1bbf6 2 #include "display_modules.h"
nikitateggi 0:c47fb0c1bbf6 3 #include "touch_modules.h"
nikitateggi 1:8316c23ec6b9 4 #include "rtc.h"
nikitateggi 3:9a06c2bed650 5 //#include "main.h"
nikitateggi 7:11f926351d8f 6 #include <ILI932x.h>
nikitateggi 7:11f926351d8f 7 #include "Arial12x12.h"
nikitateggi 7:11f926351d8f 8 #include "Arial24x23.h"
nikitateggi 7:11f926351d8f 9 //#include "Terminal6x8.h"
nikitateggi 7:11f926351d8f 10 //#include "Arial43x48_numb.h"
nikitateggi 0:c47fb0c1bbf6 11
nikitateggi 0:c47fb0c1bbf6 12
nikitateggi 7:11f926351d8f 13 //BusOut dataBus( PTC12, PTC13, PTB10, PTC9, PTD4, PTD5, PTD6, PTD7 ); // 16 pins//POC DISPALY 240*320 pixels
nikitateggi 7:11f926351d8f 14 //ILI9325_LCD lcd( PTC5, PTB9, PTC0, PTB0, &dataBus, NC, PTE31);
nikitateggi 0:c47fb0c1bbf6 15
nikitateggi 20:7c64e6ecad76 16 PinName buspins[8]={PTC12, PTC13, PTB10, PTC9, PTD4, PTD5, PTD6, PTD7 };
nikitateggi 20:7c64e6ecad76 17 ILI932x TFT(BUS_8, buspins, PTC5, PTB9, PTC0, PTB0,PTE31,"SPFD5408_2.4") ;
nikitateggi 7:11f926351d8f 18 DigitalOut backlight(PTC9) ;
nikitateggi 0:c47fb0c1bbf6 19
nikitateggi 1:8316c23ec6b9 20 void init_screen() // initializing the screen
nikitateggi 1:8316c23ec6b9 21 {
nikitateggi 7:11f926351d8f 22 //Configure the display driver
nikitateggi 7:11f926351d8f 23 TFT.FastWindow(true) ;
nikitateggi 7:11f926351d8f 24 TFT.background(Black);
nikitateggi 7:11f926351d8f 25 TFT.foreground(White);
nikitateggi 7:11f926351d8f 26 wait(0.01) ;
nikitateggi 7:11f926351d8f 27 TFT.cls();
nikitateggi 1:8316c23ec6b9 28 }
nikitateggi 0:c47fb0c1bbf6 29
nikitateggi 4:6bd81bb1790d 30 void screen_main() //main screen
nikitateggi 0:c47fb0c1bbf6 31 {
nikitateggi 7:11f926351d8f 32 char buff1[32];
nikitateggi 7:11f926351d8f 33 time_t epoch_time;
nikitateggi 7:11f926351d8f 34 epoch_time=rtc_read(); // read the time from rtc module
nikitateggi 7:11f926351d8f 35 strftime(buff1, 32, "%d-%m-%Y %H:%M",localtime(&epoch_time));
nikitateggi 7:11f926351d8f 36 backlight = 0 ;
nikitateggi 7:11f926351d8f 37 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 38 TFT.background(White) ;
nikitateggi 20:7c64e6ecad76 39 TFT.cls() ;
nikitateggi 20:7c64e6ecad76 40 wait(0.1) ;
nikitateggi 7:11f926351d8f 41 TFT.set_font((unsigned char*) Arial12x12);
nikitateggi 7:11f926351d8f 42 TFT.foreground(Red);
nikitateggi 7:11f926351d8f 43 TFT.locate(20,100) ;
nikitateggi 20:7c64e6ecad76 44 TFT.printf(buff1);
nikitateggi 20:7c64e6ecad76 45 TFT.set_font((unsigned char*) Arial24x23);
nikitateggi 20:7c64e6ecad76 46 TFT.foreground(Black);
nikitateggi 20:7c64e6ecad76 47 TFT.locate(35,20) ;
nikitateggi 7:11f926351d8f 48 TFT.printf("SENSESEMI") ;
nikitateggi 7:11f926351d8f 49 TFT.locate(45,60) ;
nikitateggi 20:7c64e6ecad76 50 TFT.printf("Sense POC") ;
nikitateggi 20:7c64e6ecad76 51 TFT.background(Olive) ;
nikitateggi 20:7c64e6ecad76 52 TFT.fillrect( 60,130,180,200,Olive);
nikitateggi 20:7c64e6ecad76 53 TFT.locate(100,140) ;
nikitateggi 7:11f926351d8f 54 TFT.printf("SYS") ;
nikitateggi 20:7c64e6ecad76 55 TFT.locate(65,170) ;
nikitateggi 7:11f926351d8f 56 TFT.printf("CONFIG") ;
nikitateggi 20:7c64e6ecad76 57 TFT.fillrect( 60,230,180,300,Olive);
nikitateggi 20:7c64e6ecad76 58 TFT.locate(90,250) ;
nikitateggi 20:7c64e6ecad76 59 TFT.printf("TEST") ;
nikitateggi 7:11f926351d8f 60 TFT.BusEnable(false) ;
nikitateggi 20:7c64e6ecad76 61 backlight = 1 ;
nikitateggi 3:9a06c2bed650 62
nikitateggi 3:9a06c2bed650 63 }
nikitateggi 1:8316c23ec6b9 64
nikitateggi 4:6bd81bb1790d 65
nikitateggi 4:6bd81bb1790d 66
nikitateggi 4:6bd81bb1790d 67 void screen_main_2(int pid) // test main screen
nikitateggi 1:8316c23ec6b9 68 {
nikitateggi 20:7c64e6ecad76 69 char buff2[10];
nikitateggi 20:7c64e6ecad76 70 backlight = 0 ;
nikitateggi 7:11f926351d8f 71 TFT.BusEnable(true) ;
nikitateggi 20:7c64e6ecad76 72 TFT.background(White) ;
nikitateggi 20:7c64e6ecad76 73 sprintf(buff2 ,"%d", pid);
nikitateggi 20:7c64e6ecad76 74 TFT.fillrect(5,20,250,150,White );
nikitateggi 20:7c64e6ecad76 75 TFT.fillrect(60,130,180,200,White );
nikitateggi 20:7c64e6ecad76 76 TFT.fillrect(60,230,180,320,White ); // changed from 300 to 320
nikitateggi 7:11f926351d8f 77 TFT.set_font((unsigned char*) Arial24x23);
nikitateggi 20:7c64e6ecad76 78 TFT.foreground(Black);
nikitateggi 20:7c64e6ecad76 79 TFT.locate(10,50) ;
nikitateggi 7:11f926351d8f 80 TFT.printf("PATIENTID") ;
nikitateggi 20:7c64e6ecad76 81 TFT.locate(180,50) ;
nikitateggi 7:11f926351d8f 82 TFT.printf(buff2) ;
nikitateggi 20:7c64e6ecad76 83 TFT.background(Orange) ;
nikitateggi 20:7c64e6ecad76 84 TFT.foreground(Black);
nikitateggi 20:7c64e6ecad76 85 TFT.fillrect( 10,130,100,200,Orange);
nikitateggi 20:7c64e6ecad76 86 TFT.locate(40,160) ;
nikitateggi 20:7c64e6ecad76 87 TFT.printf("BG") ;
nikitateggi 20:7c64e6ecad76 88 TFT.fillrect( 130,130,220,200,Orange);
nikitateggi 20:7c64e6ecad76 89 TFT.locate(145,160) ;
nikitateggi 7:11f926351d8f 90 TFT.printf("ECG") ;
nikitateggi 20:7c64e6ecad76 91 TFT.fillrect( 10,215,100,285,Orange);
nikitateggi 20:7c64e6ecad76 92 TFT.locate(40,245) ;
nikitateggi 20:7c64e6ecad76 93 TFT.printf("BP") ;
nikitateggi 20:7c64e6ecad76 94 TFT.fillrect(130,215,220,285,Orange);
nikitateggi 20:7c64e6ecad76 95 TFT.locate(130,245) ;
nikitateggi 20:7c64e6ecad76 96 TFT.printf("HOME") ;
nikitateggi 7:11f926351d8f 97 TFT.BusEnable(false) ;
nikitateggi 20:7c64e6ecad76 98 backlight = 1 ;
nikitateggi 7:11f926351d8f 99 }
nikitateggi 1:8316c23ec6b9 100
nikitateggi 1:8316c23ec6b9 101
nikitateggi 0:c47fb0c1bbf6 102
nikitateggi 4:6bd81bb1790d 103 void screen_main_1() // System Configuration main screen
nikitateggi 1:8316c23ec6b9 104 {
nikitateggi 20:7c64e6ecad76 105 backlight = 0 ;
nikitateggi 7:11f926351d8f 106 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 107 TFT.background(GreenYellow) ;
nikitateggi 20:7c64e6ecad76 108 TFT.fillrect(5,127,230,320,White );
nikitateggi 7:11f926351d8f 109 // wait(0.1) ;
nikitateggi 7:11f926351d8f 110 TFT.set_font((unsigned char*) Arial24x23);
nikitateggi 20:7c64e6ecad76 111 TFT.foreground(Black);
nikitateggi 20:7c64e6ecad76 112 TFT.fillrect( 10,130,100,200,GreenYellow);
nikitateggi 20:7c64e6ecad76 113 TFT.locate(40,160) ;
nikitateggi 7:11f926351d8f 114 TFT.printf("BLE") ;
nikitateggi 20:7c64e6ecad76 115 TFT.fillrect( 130,130,220,200,GreenYellow);
nikitateggi 20:7c64e6ecad76 116 TFT.locate(135,160) ;
nikitateggi 7:11f926351d8f 117 TFT.printf("ERASE") ;
nikitateggi 20:7c64e6ecad76 118 TFT.fillrect( 10,215,100,285,GreenYellow);
nikitateggi 20:7c64e6ecad76 119 TFT.locate(30,245) ;
nikitateggi 20:7c64e6ecad76 120 TFT.printf("FILE") ;
nikitateggi 20:7c64e6ecad76 121 TFT.fillrect(130,215,220,285,GreenYellow);
nikitateggi 20:7c64e6ecad76 122 TFT.locate(130,245) ;
nikitateggi 20:7c64e6ecad76 123 TFT.printf("HOME") ;
nikitateggi 7:11f926351d8f 124 TFT.BusEnable(false) ;
nikitateggi 20:7c64e6ecad76 125 backlight = 1 ;
nikitateggi 7:11f926351d8f 126 }
nikitateggi 0:c47fb0c1bbf6 127
nikitateggi 0:c47fb0c1bbf6 128
nikitateggi 4:6bd81bb1790d 129 void screen_ecg() //ECG screen 1
nikitateggi 0:c47fb0c1bbf6 130 {
nikitateggi 20:7c64e6ecad76 131 backlight = 0 ;
nikitateggi 7:11f926351d8f 132 TFT.BusEnable(true) ;
nikitateggi 20:7c64e6ecad76 133 TFT.fillrect(10,130,100,200,White);
nikitateggi 20:7c64e6ecad76 134 TFT.fillrect(130,130,220,200,White);
nikitateggi 20:7c64e6ecad76 135 TFT.fillrect(130,215,220,285,White);
nikitateggi 20:7c64e6ecad76 136 TFT.fillrect(10,215,100,285,White);
nikitateggi 20:7c64e6ecad76 137 TFT.fillrect(60,130,180,200,White);
nikitateggi 20:7c64e6ecad76 138 TFT.background(Green) ;
nikitateggi 7:11f926351d8f 139 TFT.fillrect( 60,130,180,200,Green);
nikitateggi 20:7c64e6ecad76 140 TFT.locate(80,150) ;
nikitateggi 7:11f926351d8f 141 TFT.printf("START") ;
nikitateggi 20:7c64e6ecad76 142 TFT.fillrect( 60,230,180,300,Green);
nikitateggi 20:7c64e6ecad76 143 TFT.locate(85,250) ;
nikitateggi 20:7c64e6ecad76 144 TFT.printf("MAIN") ;
nikitateggi 7:11f926351d8f 145 TFT.BusEnable(false) ;
nikitateggi 20:7c64e6ecad76 146 backlight = 1 ;
nikitateggi 7:11f926351d8f 147
nikitateggi 7:11f926351d8f 148
nikitateggi 7:11f926351d8f 149
nikitateggi 3:9a06c2bed650 150
nikitateggi 1:8316c23ec6b9 151 }
nikitateggi 1:8316c23ec6b9 152
nikitateggi 1:8316c23ec6b9 153
nikitateggi 0:c47fb0c1bbf6 154
suhasini 13:5d3b478ea9c7 155 void screen_ecg_2(float heart_rate) // ECG screen 2
nikitateggi 1:8316c23ec6b9 156 {
nikitateggi 20:7c64e6ecad76 157 char buf[5];
nikitateggi 20:7c64e6ecad76 158 backlight = 0 ;
nikitateggi 20:7c64e6ecad76 159 TFT.BusEnable(true) ;
nikitateggi 20:7c64e6ecad76 160 TFT.background(White) ;
nikitateggi 20:7c64e6ecad76 161 TFT.foreground(Green) ;
nikitateggi 20:7c64e6ecad76 162 sprintf (buf, "%.0f bpm",heart_rate);
nikitateggi 20:7c64e6ecad76 163 TFT.fillrect(5,90,230,150,White);
nikitateggi 20:7c64e6ecad76 164 TFT.locate(3,100) ;
nikitateggi 20:7c64e6ecad76 165 TFT.printf(" ECG Tst Done ") ;
nikitateggi 20:7c64e6ecad76 166 TFT.locate(3,150) ;
nikitateggi 20:7c64e6ecad76 167 TFT.printf(" HeartRate ") ;
nikitateggi 20:7c64e6ecad76 168 TFT.locate(50,180); // changed from 30
nikitateggi 20:7c64e6ecad76 169 TFT.printf(buf) ;
nikitateggi 20:7c64e6ecad76 170 TFT.BusEnable(false) ;
nikitateggi 20:7c64e6ecad76 171 backlight = 1 ;
nikitateggi 20:7c64e6ecad76 172 }
nikitateggi 20:7c64e6ecad76 173
nikitateggi 20:7c64e6ecad76 174 void screen_ecg_lead() // ECG screen for displaying no lead proper lead contact
nikitateggi 20:7c64e6ecad76 175 {
nikitateggi 20:7c64e6ecad76 176 backlight = 0 ;
nikitateggi 20:7c64e6ecad76 177 TFT.BusEnable(true) ;
nikitateggi 20:7c64e6ecad76 178 TFT.background(White) ;
nikitateggi 20:7c64e6ecad76 179 TFT.foreground(Red) ;
nikitateggi 20:7c64e6ecad76 180 TFT.fillrect(5,90,230,150,White);
nikitateggi 20:7c64e6ecad76 181 TFT.locate(50,100) ;
nikitateggi 20:7c64e6ecad76 182 TFT.printf("Re-check") ;
nikitateggi 20:7c64e6ecad76 183 TFT.locate(3,130) ;
nikitateggi 20:7c64e6ecad76 184 TFT.printf("Lead Connection") ;
nikitateggi 20:7c64e6ecad76 185 TFT.BusEnable(false) ;
nikitateggi 20:7c64e6ecad76 186 backlight = 1 ;
nikitateggi 20:7c64e6ecad76 187 }
nikitateggi 20:7c64e6ecad76 188
nikitateggi 20:7c64e6ecad76 189
nikitateggi 20:7c64e6ecad76 190 void screen_ecg_lead_bp_fingerdetect() // ECG screen for displaying no lead proper lead contact
nikitateggi 20:7c64e6ecad76 191 {
nikitateggi 20:7c64e6ecad76 192 backlight = 0 ;
nikitateggi 20:7c64e6ecad76 193 TFT.BusEnable(true) ;
nikitateggi 20:7c64e6ecad76 194 TFT.background(White) ;
nikitateggi 20:7c64e6ecad76 195 TFT.foreground(Red) ;
nikitateggi 20:7c64e6ecad76 196 TFT.fillrect(5,90,230,150,White);
nikitateggi 20:7c64e6ecad76 197 TFT.locate(20,100) ;
nikitateggi 20:7c64e6ecad76 198 TFT.printf("Re-check Leads") ;
nikitateggi 20:7c64e6ecad76 199 TFT.locate(50,130) ;
nikitateggi 20:7c64e6ecad76 200 TFT.printf("& finger ") ;
nikitateggi 20:7c64e6ecad76 201 TFT.locate(45,160) ;
nikitateggi 20:7c64e6ecad76 202 TFT.printf("placement") ;
nikitateggi 20:7c64e6ecad76 203 TFT.BusEnable(false) ;
nikitateggi 20:7c64e6ecad76 204 backlight = 1 ;
nikitateggi 20:7c64e6ecad76 205 }
nikitateggi 20:7c64e6ecad76 206
nikitateggi 20:7c64e6ecad76 207 void screen_ecg_bp() // added screen dispaly text //14/06
nikitateggi 20:7c64e6ecad76 208 { backlight = 0 ;
nikitateggi 20:7c64e6ecad76 209 TFT.BusEnable(true) ;
nikitateggi 20:7c64e6ecad76 210 TFT.background(Green) ;
nikitateggi 20:7c64e6ecad76 211 TFT.fillrect(10,215,230,290,White);
nikitateggi 20:7c64e6ecad76 212 //TFT.fillrect(60,230,180,300,Green);
nikitateggi 20:7c64e6ecad76 213 //TFT.locate(100,250) ;
nikitateggi 20:7c64e6ecad76 214 TFT.foreground(Black) ;
nikitateggi 20:7c64e6ecad76 215 // TFT.printf("RET") ;
nikitateggi 20:7c64e6ecad76 216 TFT.fillrect( 10,215,100,285,Green);
nikitateggi 20:7c64e6ecad76 217 TFT.locate(30,245) ;
nikitateggi 20:7c64e6ecad76 218 TFT.printf("MAIN") ;
nikitateggi 20:7c64e6ecad76 219 TFT.fillrect(130,215,220,285,Green);
nikitateggi 20:7c64e6ecad76 220 TFT.locate(155,235) ; // changed // points // 13/06
nikitateggi 20:7c64e6ecad76 221 TFT.printf("RE-") ;
nikitateggi 20:7c64e6ecad76 222 TFT.locate(145,255) ;
nikitateggi 20:7c64e6ecad76 223 TFT.printf("TEST") ;
nikitateggi 20:7c64e6ecad76 224 TFT.BusEnable(false) ;
nikitateggi 20:7c64e6ecad76 225 backlight = 1 ;
nikitateggi 3:9a06c2bed650 226
nikitateggi 1:8316c23ec6b9 227 }
nikitateggi 1:8316c23ec6b9 228
nikitateggi 1:8316c23ec6b9 229
nikitateggi 0:c47fb0c1bbf6 230
nikitateggi 4:6bd81bb1790d 231 void screen_bp() // BP main screen
nikitateggi 0:c47fb0c1bbf6 232 {
nikitateggi 7:11f926351d8f 233 backlight = 0 ;
nikitateggi 7:11f926351d8f 234 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 235 TFT.background(Green) ;
nikitateggi 7:11f926351d8f 236 TFT.foreground(Black) ;
nikitateggi 7:11f926351d8f 237 TFT.fillrect(10,130,100,200,White);
nikitateggi 7:11f926351d8f 238 TFT.fillrect(130,130,220,200,White);
nikitateggi 7:11f926351d8f 239 TFT.fillrect(10,215,100,285,White);
nikitateggi 7:11f926351d8f 240 TFT.fillrect(130,215,220,285,White);
nikitateggi 7:11f926351d8f 241 TFT.fillrect( 60,130,180,200,Green);
nikitateggi 7:11f926351d8f 242 TFT.locate(80,150) ;
nikitateggi 7:11f926351d8f 243 TFT.printf("START") ;
nikitateggi 7:11f926351d8f 244 TFT.fillrect( 60,230,180,300,Green);
nikitateggi 7:11f926351d8f 245 TFT.locate(100,250) ;
nikitateggi 20:7c64e6ecad76 246 TFT.printf("MAIN") ;
nikitateggi 7:11f926351d8f 247 TFT.BusEnable(false) ;
nikitateggi 20:7c64e6ecad76 248 backlight = 1 ;
nikitateggi 3:9a06c2bed650 249
nikitateggi 3:9a06c2bed650 250 }
nikitateggi 3:9a06c2bed650 251
nikitateggi 4:6bd81bb1790d 252
nikitateggi 4:6bd81bb1790d 253 void screen_bp1(float SBP, float DBP) // BP screen 2
nikitateggi 3:9a06c2bed650 254 {
nikitateggi 7:11f926351d8f 255 backlight = 0 ;
nikitateggi 7:11f926351d8f 256 TFT.BusEnable(true) ;
nikitateggi 20:7c64e6ecad76 257 TFT.background(White) ;
nikitateggi 20:7c64e6ecad76 258 TFT.foreground(Green) ;
nikitateggi 20:7c64e6ecad76 259 char buf[10];
nikitateggi 20:7c64e6ecad76 260 TFT.fillrect(3,130,200,200,White);
nikitateggi 20:7c64e6ecad76 261 TFT.fillrect(60,230,180,300,White);
nikitateggi 20:7c64e6ecad76 262 TFT.locate(3,100) ;
nikitateggi 20:7c64e6ecad76 263 TFT.printf(" BP Tst Done ") ;
nikitateggi 20:7c64e6ecad76 264 sprintf (buf, "SBP: %.0f ",SBP); // changed to display 2 digits after decimal point, 2May'17 Changed to Integer
nikitateggi 20:7c64e6ecad76 265 TFT.locate(5,140) ; // changed 100 to 150
nikitateggi 7:11f926351d8f 266 TFT.printf(buf) ;
nikitateggi 20:7c64e6ecad76 267 sprintf (buf, "DBP: %.0f",DBP); // changed to display 2 digits after decimal point, 2May'17, Changed to integer
nikitateggi 20:7c64e6ecad76 268 TFT.locate(5,170) ; // CHANGED from 150 to 170
nikitateggi 20:7c64e6ecad76 269 TFT.printf(buf) ;
nikitateggi 20:7c64e6ecad76 270 //TFT.fillrect(60,230,180,300,Green);
nikitateggi 20:7c64e6ecad76 271 //TFT.locate(85,250) ;
nikitateggi 20:7c64e6ecad76 272 /* TFT.foreground(Black) ; // commented //16/06
nikitateggi 20:7c64e6ecad76 273 TFT.background(Green) ;
nikitateggi 20:7c64e6ecad76 274 //TFT.printf("RET") ;
nikitateggi 20:7c64e6ecad76 275 TFT.fillrect( 10,215,100,285,Green);
nikitateggi 20:7c64e6ecad76 276 TFT.locate(30,245) ;
nikitateggi 20:7c64e6ecad76 277 TFT.printf("RET") ;
nikitateggi 20:7c64e6ecad76 278 TFT.fillrect(130,215,220,285,Green);
nikitateggi 20:7c64e6ecad76 279 TFT.locate(155,235) ; // changed // points // 13/06
nikitateggi 20:7c64e6ecad76 280 TFT.printf("RE-") ;
nikitateggi 20:7c64e6ecad76 281 TFT.locate(145,255) ;
nikitateggi 20:7c64e6ecad76 282 TFT.printf("TEST") ; */
nikitateggi 20:7c64e6ecad76 283 TFT.BusEnable(false) ;
nikitateggi 20:7c64e6ecad76 284 backlight = 1 ;
nikitateggi 3:9a06c2bed650 285 }
nikitateggi 3:9a06c2bed650 286
nikitateggi 3:9a06c2bed650 287
nikitateggi 3:9a06c2bed650 288
nikitateggi 0:c47fb0c1bbf6 289
nikitateggi 0:c47fb0c1bbf6 290
nikitateggi 1:8316c23ec6b9 291 void screen_glc() // glc main screen
nikitateggi 0:c47fb0c1bbf6 292 {
nikitateggi 3:9a06c2bed650 293
nikitateggi 20:7c64e6ecad76 294 backlight = 0 ;
nikitateggi 7:11f926351d8f 295 TFT.BusEnable(true) ;
nikitateggi 20:7c64e6ecad76 296 TFT.background(Green) ;
nikitateggi 20:7c64e6ecad76 297 TFT.foreground(Black) ;
nikitateggi 20:7c64e6ecad76 298 TFT.fillrect(10,130,100,200,White);
nikitateggi 20:7c64e6ecad76 299 TFT.fillrect(130,130,220,200,White);
nikitateggi 20:7c64e6ecad76 300 TFT.fillrect(10,215,100,285,White);
nikitateggi 20:7c64e6ecad76 301 TFT.fillrect(130,215,220,285,White);
nikitateggi 20:7c64e6ecad76 302 // TFT.fillrect( 60,130,180,200,Green);
nikitateggi 20:7c64e6ecad76 303 // TFT.locate(80,150) ;
nikitateggi 20:7c64e6ecad76 304 // TFT.printf("START") ;
nikitateggi 20:7c64e6ecad76 305 TFT.fillrect( 10,130,100,200,Green);
nikitateggi 20:7c64e6ecad76 306 TFT.locate(30,160) ; // changed to 30 from 40
nikitateggi 20:7c64e6ecad76 307 TFT.printf("FBS") ;
nikitateggi 20:7c64e6ecad76 308 TFT.fillrect( 130,130,220,200,Green);
nikitateggi 20:7c64e6ecad76 309 TFT.locate(155,160) ;
nikitateggi 20:7c64e6ecad76 310 TFT.printf("PP") ;
nikitateggi 20:7c64e6ecad76 311 TFT.fillrect( 10,215,100,285,Green);
nikitateggi 20:7c64e6ecad76 312 TFT.locate(20,245) ;
nikitateggi 20:7c64e6ecad76 313 TFT.printf("RAN") ;
nikitateggi 20:7c64e6ecad76 314 TFT.fillrect(130,215,220,285,Green);
nikitateggi 20:7c64e6ecad76 315 TFT.locate(155,245);
nikitateggi 20:7c64e6ecad76 316 TFT.printf("MAIN") ;
nikitateggi 20:7c64e6ecad76 317 // TFT.fillrect( 60,230,180,300,Green);
nikitateggi 20:7c64e6ecad76 318 // TFT.locate(100,250) ;
nikitateggi 20:7c64e6ecad76 319 // TFT.printf("RET") ;
nikitateggi 7:11f926351d8f 320 TFT.BusEnable(false) ;
nikitateggi 20:7c64e6ecad76 321 backlight = 1 ;
nikitateggi 3:9a06c2bed650 322
nikitateggi 0:c47fb0c1bbf6 323 }
nikitateggi 0:c47fb0c1bbf6 324
nikitateggi 4:6bd81bb1790d 325
nikitateggi 4:6bd81bb1790d 326 void screen_bp2() //BP screen 3
nikitateggi 3:9a06c2bed650 327 {
nikitateggi 3:9a06c2bed650 328
nikitateggi 7:11f926351d8f 329 /* lcd.FillRoundRect(3,130,200,200,COLOR_BLACK);
nikitateggi 3:9a06c2bed650 330 lcd.FillRoundRect(60,230,180,300,COLOR_BLACK);
nikitateggi 7:11f926351d8f 331 lcd.FillRect(5,215,230,290,COLOR_BLACK);*/
nikitateggi 3:9a06c2bed650 332
nikitateggi 3:9a06c2bed650 333 }
nikitateggi 1:8316c23ec6b9 334
nikitateggi 1:8316c23ec6b9 335
nikitateggi 4:6bd81bb1790d 336 void ecg_countdown() // ECG measurement countdown
nikitateggi 1:8316c23ec6b9 337 {
nikitateggi 20:7c64e6ecad76 338 backlight = 0 ;
nikitateggi 7:11f926351d8f 339 TFT.BusEnable(true) ;
nikitateggi 20:7c64e6ecad76 340 TFT.background(White) ;
nikitateggi 20:7c64e6ecad76 341 TFT.foreground(Green) ;
nikitateggi 20:7c64e6ecad76 342 char tim1[5];
nikitateggi 20:7c64e6ecad76 343 TFT.fillrect(3,130,200,200,White);
nikitateggi 20:7c64e6ecad76 344 TFT.fillrect(60,230,180,300,White);
nikitateggi 20:7c64e6ecad76 345 TFT.fillrect(5,215,230,290,White);
nikitateggi 20:7c64e6ecad76 346 TFT.locate(25,100) ;
nikitateggi 20:7c64e6ecad76 347 TFT.printf("ECG starts in") ;
nikitateggi 20:7c64e6ecad76 348 for(int i=5;i>=0;i--)
nikitateggi 20:7c64e6ecad76 349 {
nikitateggi 1:8316c23ec6b9 350 wait(1);
nikitateggi 1:8316c23ec6b9 351 sprintf (tim1, "%d",i);
nikitateggi 7:11f926351d8f 352 TFT.locate(120,120) ;
nikitateggi 20:7c64e6ecad76 353 TFT.printf(tim1) ;
nikitateggi 20:7c64e6ecad76 354 }
nikitateggi 7:11f926351d8f 355 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 356 backlight = 1 ;
nikitateggi 7:11f926351d8f 357
nikitateggi 3:9a06c2bed650 358
nikitateggi 1:8316c23ec6b9 359 }
nikitateggi 1:8316c23ec6b9 360
suhasini 6:5e33a0f01476 361 void bp_countdown() // ECG measurement countdown
suhasini 6:5e33a0f01476 362 {
nikitateggi 20:7c64e6ecad76 363 backlight = 0 ;
nikitateggi 7:11f926351d8f 364 TFT.BusEnable(true) ;
nikitateggi 20:7c64e6ecad76 365 TFT.background(White) ;
nikitateggi 20:7c64e6ecad76 366 TFT.foreground(Green) ;
nikitateggi 20:7c64e6ecad76 367 char tim1[5];
nikitateggi 20:7c64e6ecad76 368 TFT.fillrect(3,130,200,200,White);
nikitateggi 20:7c64e6ecad76 369 TFT.fillrect(60,230,180,300,White);
nikitateggi 20:7c64e6ecad76 370 TFT.fillrect(1,80,240,290,White); //changed the points// 13/06
nikitateggi 20:7c64e6ecad76 371 TFT.locate(25,100) ;
nikitateggi 20:7c64e6ecad76 372 TFT.printf("BP starts in") ;
nikitateggi 20:7c64e6ecad76 373 for(int i=5;i>=0;i--)
suhasini 6:5e33a0f01476 374 {
suhasini 6:5e33a0f01476 375 wait(1);
suhasini 6:5e33a0f01476 376 sprintf (tim1, "%d",i);
nikitateggi 7:11f926351d8f 377 TFT.locate(120,120) ;
nikitateggi 20:7c64e6ecad76 378 TFT.printf(tim1) ;
suhasini 6:5e33a0f01476 379 }
nikitateggi 7:11f926351d8f 380 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 381 backlight = 1 ;
nikitateggi 7:11f926351d8f 382 }
nikitateggi 1:8316c23ec6b9 383
nikitateggi 4:6bd81bb1790d 384 void screen_again() // screen to press 'yes' or 'no' to repeat the test
nikitateggi 7:11f926351d8f 385 {
nikitateggi 20:7c64e6ecad76 386 backlight = 0 ;
nikitateggi 20:7c64e6ecad76 387 TFT.BusEnable(true) ;
nikitateggi 20:7c64e6ecad76 388 TFT.background(White) ;
nikitateggi 20:7c64e6ecad76 389 TFT.foreground(Black) ;
nikitateggi 20:7c64e6ecad76 390 TFT.fillrect(5,127,230,200,White);
nikitateggi 20:7c64e6ecad76 391 TFT.locate(50,130) ;
nikitateggi 20:7c64e6ecad76 392 TFT.printf("Take test") ;
nikitateggi 20:7c64e6ecad76 393 TFT.locate(75,160) ;
nikitateggi 20:7c64e6ecad76 394 TFT.printf("again?") ;
nikitateggi 20:7c64e6ecad76 395 TFT.background(Orange) ;
nikitateggi 20:7c64e6ecad76 396 TFT.locate(30,245) ;
nikitateggi 20:7c64e6ecad76 397 TFT.printf("YES") ;
nikitateggi 20:7c64e6ecad76 398 TFT.locate(135,245) ;
nikitateggi 20:7c64e6ecad76 399 TFT.printf(" NO ") ;
nikitateggi 20:7c64e6ecad76 400 backlight = 1 ;
nikitateggi 7:11f926351d8f 401 TFT.BusEnable(false) ;
nikitateggi 3:9a06c2bed650 402
nikitateggi 1:8316c23ec6b9 403 }
nikitateggi 1:8316c23ec6b9 404
nikitateggi 1:8316c23ec6b9 405
nikitateggi 4:6bd81bb1790d 406 void screen_glc_2() // GLC screen 3 after test
nikitateggi 1:8316c23ec6b9 407 {
nikitateggi 3:9a06c2bed650 408
nikitateggi 20:7c64e6ecad76 409 backlight = 0 ;
nikitateggi 7:11f926351d8f 410 TFT.BusEnable(true) ;
nikitateggi 20:7c64e6ecad76 411 TFT.background(White) ;
nikitateggi 20:7c64e6ecad76 412 TFT.foreground(Black) ;
nikitateggi 20:7c64e6ecad76 413 TFT.fillrect(5,127,230,320,White);
nikitateggi 20:7c64e6ecad76 414 //TFT.fillrect(60,230,180,300,Green);
nikitateggi 20:7c64e6ecad76 415 //TFT.locate(85,250) ;
nikitateggi 20:7c64e6ecad76 416 TFT.background(Green);
nikitateggi 20:7c64e6ecad76 417 //TFT.printf("RET") ;
nikitateggi 20:7c64e6ecad76 418 TFT.fillrect( 10,215,100,285,Green);
nikitateggi 20:7c64e6ecad76 419 TFT.locate(30,245) ;
nikitateggi 20:7c64e6ecad76 420 TFT.printf("MAIN") ;
nikitateggi 20:7c64e6ecad76 421 TFT.fillrect(130,215,220,285,Green);
nikitateggi 20:7c64e6ecad76 422 TFT.locate(155,235) ; // changed // points // 13/06
nikitateggi 20:7c64e6ecad76 423 TFT.printf("RE-") ;
nikitateggi 20:7c64e6ecad76 424 TFT.locate(140,255) ; // changed from 145 to 140
nikitateggi 20:7c64e6ecad76 425 TFT.printf("TEST") ;
nikitateggi 20:7c64e6ecad76 426 backlight = 1 ;
nikitateggi 20:7c64e6ecad76 427 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 428
nikitateggi 7:11f926351d8f 429
nikitateggi 7:11f926351d8f 430
nikitateggi 1:8316c23ec6b9 431 }
nikitateggi 1:8316c23ec6b9 432
nikitateggi 4:6bd81bb1790d 433
nikitateggi 4:6bd81bb1790d 434 void glc_1() // GLC screen
nikitateggi 7:11f926351d8f 435 {
nikitateggi 20:7c64e6ecad76 436 backlight = 0 ;
nikitateggi 20:7c64e6ecad76 437 TFT.BusEnable(true) ;
nikitateggi 20:7c64e6ecad76 438 TFT.background(White) ;
nikitateggi 20:7c64e6ecad76 439 TFT.foreground(Magenta ) ;
nikitateggi 20:7c64e6ecad76 440 TFT.fillrect(3,130,200,200,White);
nikitateggi 20:7c64e6ecad76 441 TFT.fillrect(60,230,180,300,White);
nikitateggi 20:7c64e6ecad76 442 TFT.fillrect(5,215,230,290,White);
nikitateggi 20:7c64e6ecad76 443 TFT.fillrect( 130,130,220,200,White);
nikitateggi 20:7c64e6ecad76 444 TFT.locate(5,130) ;
nikitateggi 20:7c64e6ecad76 445 TFT.printf("Blood Glucose") ;
nikitateggi 20:7c64e6ecad76 446 TFT.locate(5,160) ;
nikitateggi 20:7c64e6ecad76 447 TFT.printf("Insert strip") ;
nikitateggi 20:7c64e6ecad76 448 TFT.BusEnable(false) ;
nikitateggi 20:7c64e6ecad76 449 backlight = 1 ;
nikitateggi 7:11f926351d8f 450
nikitateggi 7:11f926351d8f 451
nikitateggi 7:11f926351d8f 452
nikitateggi 1:8316c23ec6b9 453 }
nikitateggi 1:8316c23ec6b9 454
nikitateggi 4:6bd81bb1790d 455 void glc_2() // GLC screen
nikitateggi 1:8316c23ec6b9 456 {
nikitateggi 20:7c64e6ecad76 457 backlight = 0 ;
nikitateggi 20:7c64e6ecad76 458 TFT.BusEnable(true) ;
nikitateggi 20:7c64e6ecad76 459 TFT.locate(5,160) ;
nikitateggi 20:7c64e6ecad76 460 TFT.printf("Strip Detected") ;
nikitateggi 20:7c64e6ecad76 461 TFT.locate(5,190) ;
nikitateggi 20:7c64e6ecad76 462 TFT.printf("Insert Blood") ;
nikitateggi 20:7c64e6ecad76 463 TFT.BusEnable(false) ;
nikitateggi 20:7c64e6ecad76 464 backlight = 1 ;
nikitateggi 1:8316c23ec6b9 465 }
nikitateggi 0:c47fb0c1bbf6 466
nikitateggi 4:6bd81bb1790d 467
nikitateggi 4:6bd81bb1790d 468 void glc_3() // GLC screen
nikitateggi 1:8316c23ec6b9 469 {
nikitateggi 20:7c64e6ecad76 470 backlight = 0 ;
nikitateggi 20:7c64e6ecad76 471 TFT.BusEnable(true) ;
nikitateggi 20:7c64e6ecad76 472 TFT.locate(5,190) ;
nikitateggi 20:7c64e6ecad76 473 TFT.printf("Blood Detected") ;
nikitateggi 20:7c64e6ecad76 474 TFT.locate( 5,220) ;
nikitateggi 20:7c64e6ecad76 475 TFT.printf("computing") ;
nikitateggi 20:7c64e6ecad76 476 TFT.BusEnable(false) ;
nikitateggi 20:7c64e6ecad76 477 backlight = 1 ;
nikitateggi 7:11f926351d8f 478 }
nikitateggi 1:8316c23ec6b9 479
nikitateggi 4:6bd81bb1790d 480
nidhinvarghese 15:208b146151ba 481 void glc_4(uint16_t mgdl) // GLC screen to display blood glucose level on the LCD
nikitateggi 7:11f926351d8f 482 {
nikitateggi 20:7c64e6ecad76 483 char buf[10];
nikitateggi 20:7c64e6ecad76 484 sprintf (buf, " BG %d mg/dl",mgdl);
nikitateggi 20:7c64e6ecad76 485 backlight = 0 ;
nikitateggi 20:7c64e6ecad76 486 TFT.BusEnable(true) ;
nikitateggi 20:7c64e6ecad76 487 TFT.fillrect(5,127,230,320,White);
nikitateggi 20:7c64e6ecad76 488 TFT.locate(3,100) ;
nikitateggi 20:7c64e6ecad76 489 TFT.printf(" BG Tst Done ") ;
nikitateggi 20:7c64e6ecad76 490 TFT.locate(5,130) ;
nikitateggi 7:11f926351d8f 491 TFT.printf(buf) ;
nikitateggi 20:7c64e6ecad76 492 TFT.locate(5,160) ;
nikitateggi 20:7c64e6ecad76 493 TFT.printf("(Range 70-120 mg/dl)") ; // added 16/06
nikitateggi 20:7c64e6ecad76 494 TFT.BusEnable(false) ;
nikitateggi 20:7c64e6ecad76 495 backlight = 1 ;
nikitateggi 20:7c64e6ecad76 496 }
nikitateggi 20:7c64e6ecad76 497
nikitateggi 20:7c64e6ecad76 498