export test

Dependencies:   SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217

Fork of Int_Demo_09May2017_Suhasini_HRavg_Nikita_ili9341 by nikita teggi

Committer:
nidhinvarghese
Date:
Mon Jun 05 09:14:44 2017 +0000
Revision:
15:208b146151ba
Parent:
13:5d3b478ea9c7
Child:
20:7c64e6ecad76
Heart rate is calculated; GLC - Not working

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 7:11f926351d8f 16 PinName buspins[8]={PTC12, PTC13, PTB10, PTC9, PTD4, PTD5, PTD6, PTD7 };
nikitateggi 7:11f926351d8f 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 7:11f926351d8f 39 TFT.cls() ;
nikitateggi 7:11f926351d8f 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 7:11f926351d8f 44 TFT.printf(buff1);
nikitateggi 7:11f926351d8f 45 TFT.set_font((unsigned char*) Arial24x23);
nikitateggi 7:11f926351d8f 46 TFT.foreground(Black);
nikitateggi 7:11f926351d8f 47 TFT.locate(35,20) ;
nikitateggi 7:11f926351d8f 48 TFT.printf("SENSESEMI") ;
nikitateggi 7:11f926351d8f 49 TFT.locate(45,60) ;
nikitateggi 7:11f926351d8f 50 TFT.printf("SenseSmart") ;
nikitateggi 7:11f926351d8f 51 TFT.background(Olive) ;
nikitateggi 7:11f926351d8f 52 TFT.fillrect( 60,130,180,200,Olive);
nikitateggi 7:11f926351d8f 53 TFT.locate(100,140) ;
nikitateggi 7:11f926351d8f 54 TFT.printf("SYS") ;
nikitateggi 7:11f926351d8f 55 TFT.locate(65,170) ;
nikitateggi 7:11f926351d8f 56 TFT.printf("CONFIG") ;
nikitateggi 7:11f926351d8f 57 TFT.fillrect( 60,230,180,300,Olive);
nikitateggi 7:11f926351d8f 58 TFT.locate(90,250) ;
nikitateggi 7:11f926351d8f 59 TFT.printf("TEST") ;
nikitateggi 7:11f926351d8f 60 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 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 7:11f926351d8f 69 char buff2[10];
nikitateggi 7:11f926351d8f 70 backlight = 0 ;
nikitateggi 7:11f926351d8f 71 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 72 TFT.background(White) ;
nikitateggi 7:11f926351d8f 73 sprintf(buff2 ,"%d", pid);
nikitateggi 7:11f926351d8f 74 TFT.fillrect(5,20,250,150,White );
nikitateggi 7:11f926351d8f 75 TFT.fillrect(60,130,180,200,White );
nikitateggi 7:11f926351d8f 76 TFT.fillrect(60,230,180,300,White );
nikitateggi 7:11f926351d8f 77 TFT.set_font((unsigned char*) Arial24x23);
nikitateggi 7:11f926351d8f 78 TFT.foreground(Black);
nikitateggi 7:11f926351d8f 79 TFT.locate(10,50) ;
nikitateggi 7:11f926351d8f 80 TFT.printf("PATIENTID") ;
nikitateggi 7:11f926351d8f 81 TFT.locate(180,50) ;
nikitateggi 7:11f926351d8f 82 TFT.printf(buff2) ;
nikitateggi 7:11f926351d8f 83 TFT.background(Orange) ;
nikitateggi 7:11f926351d8f 84 TFT.foreground(Black);
nikitateggi 7:11f926351d8f 85 TFT.fillrect( 10,130,100,200,Orange);
nikitateggi 7:11f926351d8f 86 TFT.locate(40,160) ;
nikitateggi 7:11f926351d8f 87 TFT.printf("BG") ;
nikitateggi 7:11f926351d8f 88 TFT.fillrect( 130,130,220,200,Orange);
nikitateggi 7:11f926351d8f 89 TFT.locate(145,160) ;
nikitateggi 7:11f926351d8f 90 TFT.printf("ECG") ;
nikitateggi 7:11f926351d8f 91 TFT.fillrect( 10,215,100,285,Orange);
nikitateggi 7:11f926351d8f 92 TFT.locate(40,245) ;
nikitateggi 7:11f926351d8f 93 TFT.printf("BP") ;
nikitateggi 7:11f926351d8f 94 TFT.fillrect(130,215,220,285,Orange);
nikitateggi 7:11f926351d8f 95 TFT.locate(130,245) ;
nikitateggi 7:11f926351d8f 96 TFT.printf("HOME") ;
nikitateggi 7:11f926351d8f 97
nikitateggi 7:11f926351d8f 98 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 99 backlight = 1 ;
nikitateggi 7:11f926351d8f 100 }
nikitateggi 1:8316c23ec6b9 101
nikitateggi 1:8316c23ec6b9 102
nikitateggi 0:c47fb0c1bbf6 103
nikitateggi 4:6bd81bb1790d 104 void screen_main_1() // System Configuration main screen
nikitateggi 1:8316c23ec6b9 105 {
nikitateggi 7:11f926351d8f 106 backlight = 0 ;
nikitateggi 7:11f926351d8f 107 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 108 TFT.background(GreenYellow) ;
nikitateggi 7:11f926351d8f 109 TFT.fillrect(5,127,230,320,White );
nikitateggi 7:11f926351d8f 110 // wait(0.1) ;
nikitateggi 7:11f926351d8f 111 TFT.set_font((unsigned char*) Arial24x23);
nikitateggi 7:11f926351d8f 112 TFT.foreground(Black);
nikitateggi 7:11f926351d8f 113 TFT.fillrect( 10,130,100,200,GreenYellow);
nikitateggi 7:11f926351d8f 114 TFT.locate(40,160) ;
nikitateggi 7:11f926351d8f 115 TFT.printf("BLE") ;
nikitateggi 7:11f926351d8f 116 TFT.fillrect( 130,130,220,200,GreenYellow);
nikitateggi 7:11f926351d8f 117 TFT.locate(135,160) ;
nikitateggi 7:11f926351d8f 118 TFT.printf("ERASE") ;
nikitateggi 7:11f926351d8f 119 TFT.fillrect( 10,215,100,285,GreenYellow);
nikitateggi 7:11f926351d8f 120 TFT.locate(30,245) ;
nikitateggi 7:11f926351d8f 121 TFT.printf("FILE") ;
nikitateggi 7:11f926351d8f 122 TFT.fillrect(130,215,220,285,GreenYellow);
nikitateggi 7:11f926351d8f 123 TFT.locate(130,245) ;
nikitateggi 7:11f926351d8f 124 TFT.printf("HOME") ;
nikitateggi 7:11f926351d8f 125
nikitateggi 7:11f926351d8f 126 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 127 backlight = 1 ;
nikitateggi 7:11f926351d8f 128 }
nikitateggi 0:c47fb0c1bbf6 129
nikitateggi 0:c47fb0c1bbf6 130
nikitateggi 4:6bd81bb1790d 131 void screen_ecg() //ECG screen 1
nikitateggi 0:c47fb0c1bbf6 132 {
nikitateggi 7:11f926351d8f 133 backlight = 0 ;
nikitateggi 7:11f926351d8f 134 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 135 TFT.fillrect(10,130,100,200,White);
nikitateggi 7:11f926351d8f 136 TFT.fillrect(130,130,220,200,White);
nikitateggi 7:11f926351d8f 137 TFT.fillrect(130,215,220,285,White);
nikitateggi 7:11f926351d8f 138 TFT.fillrect(10,215,100,285,White);
nikitateggi 7:11f926351d8f 139 TFT.fillrect(60,130,180,200,White);
nikitateggi 7:11f926351d8f 140 TFT.background(Green) ;
nikitateggi 7:11f926351d8f 141 TFT.fillrect( 60,130,180,200,Green);
nikitateggi 7:11f926351d8f 142 TFT.locate(80,150) ;
nikitateggi 7:11f926351d8f 143 TFT.printf("START") ;
nikitateggi 7:11f926351d8f 144 TFT.fillrect( 60,230,180,300,Green);
nikitateggi 7:11f926351d8f 145 TFT.locate(85,250) ;
nikitateggi 7:11f926351d8f 146 TFT.printf("RET") ;
nikitateggi 7:11f926351d8f 147 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 148 backlight = 1 ;
nikitateggi 7:11f926351d8f 149
nikitateggi 7:11f926351d8f 150
nikitateggi 7:11f926351d8f 151
nikitateggi 3:9a06c2bed650 152
nikitateggi 1:8316c23ec6b9 153 }
nikitateggi 1:8316c23ec6b9 154
nikitateggi 1:8316c23ec6b9 155
nikitateggi 0:c47fb0c1bbf6 156
suhasini 13:5d3b478ea9c7 157 void screen_ecg_2(float heart_rate) // ECG screen 2
nikitateggi 1:8316c23ec6b9 158 {
suhasini 13:5d3b478ea9c7 159 char buf[5];
nikitateggi 7:11f926351d8f 160 backlight = 0 ;
nikitateggi 7:11f926351d8f 161 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 162 TFT.background(White) ;
nikitateggi 7:11f926351d8f 163 TFT.foreground(Green) ;
suhasini 13:5d3b478ea9c7 164 sprintf (buf, "%.0f bpm",heart_rate);
nikitateggi 7:11f926351d8f 165 TFT.fillrect(5,90,230,150,White);
nikitateggi 7:11f926351d8f 166 TFT.locate(3,100) ;
nikitateggi 7:11f926351d8f 167 TFT.printf(" Tst is Done ") ;
nikitateggi 7:11f926351d8f 168 TFT.locate(3,150) ;
nikitateggi 7:11f926351d8f 169 TFT.printf(" HeartRate ") ;
suhasini 13:5d3b478ea9c7 170 TFT.locate(30,180);
suhasini 13:5d3b478ea9c7 171 TFT.printf(buf) ;
nikitateggi 7:11f926351d8f 172 TFT.background(Green) ;
nikitateggi 7:11f926351d8f 173 TFT.fillrect(10,215,230,290,White);
nikitateggi 7:11f926351d8f 174 TFT.fillrect(60,230,180,300,Green);
nikitateggi 7:11f926351d8f 175 TFT.locate(100,250) ;
nikitateggi 7:11f926351d8f 176 TFT.foreground(Black) ;
nikitateggi 7:11f926351d8f 177 TFT.printf("RET") ;
nikitateggi 7:11f926351d8f 178 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 179 backlight = 1 ;
nikitateggi 3:9a06c2bed650 180
nikitateggi 1:8316c23ec6b9 181 }
nikitateggi 1:8316c23ec6b9 182
nikitateggi 1:8316c23ec6b9 183
nikitateggi 0:c47fb0c1bbf6 184
nikitateggi 4:6bd81bb1790d 185 void screen_bp() // BP main screen
nikitateggi 0:c47fb0c1bbf6 186 {
nikitateggi 7:11f926351d8f 187 backlight = 0 ;
nikitateggi 7:11f926351d8f 188 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 189 TFT.background(Green) ;
nikitateggi 7:11f926351d8f 190 TFT.foreground(Black) ;
nikitateggi 7:11f926351d8f 191 TFT.fillrect(10,130,100,200,White);
nikitateggi 7:11f926351d8f 192 TFT.fillrect(130,130,220,200,White);
nikitateggi 7:11f926351d8f 193 TFT.fillrect(10,215,100,285,White);
nikitateggi 7:11f926351d8f 194 TFT.fillrect(130,215,220,285,White);
nikitateggi 7:11f926351d8f 195 TFT.fillrect( 60,130,180,200,Green);
nikitateggi 7:11f926351d8f 196 TFT.locate(80,150) ;
nikitateggi 7:11f926351d8f 197 TFT.printf("START") ;
nikitateggi 7:11f926351d8f 198 TFT.fillrect( 60,230,180,300,Green);
nikitateggi 7:11f926351d8f 199 TFT.locate(100,250) ;
nikitateggi 7:11f926351d8f 200 TFT.printf("RET") ;
nikitateggi 7:11f926351d8f 201 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 202 backlight = 1 ;
nikitateggi 3:9a06c2bed650 203
nikitateggi 3:9a06c2bed650 204 }
nikitateggi 3:9a06c2bed650 205
nikitateggi 4:6bd81bb1790d 206
nikitateggi 4:6bd81bb1790d 207 void screen_bp1(float SBP, float DBP) // BP screen 2
nikitateggi 3:9a06c2bed650 208 {
nikitateggi 7:11f926351d8f 209 backlight = 0 ;
nikitateggi 7:11f926351d8f 210 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 211 TFT.background(White) ;
nikitateggi 7:11f926351d8f 212 TFT.foreground(Green) ;
nikitateggi 7:11f926351d8f 213 char buf[10];
nikitateggi 9:d0ecb61d219e 214 TFT.fillrect(3,130,200,200,White);
nikitateggi 9:d0ecb61d219e 215 TFT.fillrect(60,230,180,300,White);
nidhinvarghese 10:aeff3309002a 216 sprintf (buf, "SBP: %.0f ",SBP); // changed to display 2 digits after decimal point, 2May'17 Changed to Integer
nikitateggi 7:11f926351d8f 217 TFT.locate(5,100) ;
nikitateggi 7:11f926351d8f 218 TFT.printf(buf) ;
nidhinvarghese 10:aeff3309002a 219 sprintf (buf, "DBP: %.0f",DBP); // changed to display 2 digits after decimal point, 2May'17, Changed to integer
nikitateggi 7:11f926351d8f 220 TFT.locate(5,150) ;
nikitateggi 7:11f926351d8f 221 TFT.printf(buf) ;
nikitateggi 7:11f926351d8f 222 TFT.fillrect(60,230,180,300,Green);
nikitateggi 7:11f926351d8f 223 TFT.locate(85,250) ;
nikitateggi 7:11f926351d8f 224 TFT.foreground(Black) ;
nikitateggi 9:d0ecb61d219e 225 TFT.background(Green) ;
nikitateggi 7:11f926351d8f 226 TFT.printf("RET") ;
nikitateggi 7:11f926351d8f 227 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 228 backlight = 1 ;
nikitateggi 3:9a06c2bed650 229 }
nikitateggi 3:9a06c2bed650 230
nikitateggi 3:9a06c2bed650 231
nikitateggi 3:9a06c2bed650 232
nikitateggi 0:c47fb0c1bbf6 233
nikitateggi 0:c47fb0c1bbf6 234
nikitateggi 1:8316c23ec6b9 235 void screen_glc() // glc main screen
nikitateggi 0:c47fb0c1bbf6 236 {
nikitateggi 3:9a06c2bed650 237
nikitateggi 7:11f926351d8f 238 backlight = 0 ;
nikitateggi 7:11f926351d8f 239 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 240 TFT.background(Green) ;
nikitateggi 7:11f926351d8f 241 TFT.foreground(Black) ;
nikitateggi 7:11f926351d8f 242 TFT.fillrect(10,130,100,200,White);
nikitateggi 7:11f926351d8f 243 TFT.fillrect(130,130,220,200,White);
nikitateggi 7:11f926351d8f 244 TFT.fillrect(10,215,100,285,White);
nikitateggi 7:11f926351d8f 245 TFT.fillrect(130,215,220,285,White);
nikitateggi 7:11f926351d8f 246 TFT.fillrect( 60,130,180,200,Green);
nikitateggi 7:11f926351d8f 247 TFT.locate(80,150) ;
nikitateggi 7:11f926351d8f 248 TFT.printf("START") ;
nikitateggi 7:11f926351d8f 249 TFT.fillrect( 60,230,180,300,Green);
nikitateggi 7:11f926351d8f 250 TFT.locate(100,250) ;
nikitateggi 7:11f926351d8f 251 TFT.printf("RET") ;
nikitateggi 7:11f926351d8f 252 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 253 backlight = 1 ;
nikitateggi 3:9a06c2bed650 254
nikitateggi 0:c47fb0c1bbf6 255 }
nikitateggi 0:c47fb0c1bbf6 256
nikitateggi 4:6bd81bb1790d 257
nikitateggi 4:6bd81bb1790d 258 void screen_bp2() //BP screen 3
nikitateggi 3:9a06c2bed650 259 {
nikitateggi 3:9a06c2bed650 260
nikitateggi 7:11f926351d8f 261 /* lcd.FillRoundRect(3,130,200,200,COLOR_BLACK);
nikitateggi 3:9a06c2bed650 262 lcd.FillRoundRect(60,230,180,300,COLOR_BLACK);
nikitateggi 7:11f926351d8f 263 lcd.FillRect(5,215,230,290,COLOR_BLACK);*/
nikitateggi 3:9a06c2bed650 264
nikitateggi 3:9a06c2bed650 265 }
nikitateggi 1:8316c23ec6b9 266
nikitateggi 1:8316c23ec6b9 267
nikitateggi 4:6bd81bb1790d 268 void ecg_countdown() // ECG measurement countdown
nikitateggi 1:8316c23ec6b9 269 {
nikitateggi 7:11f926351d8f 270 backlight = 0 ;
nikitateggi 7:11f926351d8f 271 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 272 TFT.background(White) ;
nikitateggi 7:11f926351d8f 273 TFT.foreground(Green) ;
nikitateggi 7:11f926351d8f 274 char tim1[5];
nikitateggi 7:11f926351d8f 275 TFT.fillrect(3,130,200,200,White);
nikitateggi 7:11f926351d8f 276 TFT.fillrect(60,230,180,300,White);
nikitateggi 7:11f926351d8f 277 TFT.fillrect(5,215,230,290,White);
nikitateggi 7:11f926351d8f 278 TFT.locate(25,100) ;
nikitateggi 7:11f926351d8f 279 TFT.printf("ECG starts in") ;
nikitateggi 7:11f926351d8f 280 for(int i=5;i>=0;i--)
nikitateggi 1:8316c23ec6b9 281 {
nikitateggi 1:8316c23ec6b9 282 wait(1);
nikitateggi 1:8316c23ec6b9 283 sprintf (tim1, "%d",i);
nikitateggi 7:11f926351d8f 284 TFT.locate(120,120) ;
nikitateggi 7:11f926351d8f 285 TFT.printf(tim1) ;
nikitateggi 1:8316c23ec6b9 286 }
nikitateggi 7:11f926351d8f 287 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 288 backlight = 1 ;
nikitateggi 7:11f926351d8f 289
nikitateggi 3:9a06c2bed650 290
nikitateggi 1:8316c23ec6b9 291 }
nikitateggi 1:8316c23ec6b9 292
suhasini 6:5e33a0f01476 293 void bp_countdown() // ECG measurement countdown
suhasini 6:5e33a0f01476 294 {
nikitateggi 7:11f926351d8f 295 backlight = 0 ;
nikitateggi 7:11f926351d8f 296 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 297 TFT.background(White) ;
nikitateggi 7:11f926351d8f 298 TFT.foreground(Green) ;
nikitateggi 7:11f926351d8f 299 char tim1[5];
nikitateggi 7:11f926351d8f 300 TFT.fillrect(3,130,200,200,White);
nikitateggi 7:11f926351d8f 301 TFT.fillrect(60,230,180,300,White);
nikitateggi 7:11f926351d8f 302 TFT.fillrect(5,215,230,290,White);
nikitateggi 7:11f926351d8f 303 TFT.locate(25,100) ;
nikitateggi 7:11f926351d8f 304 TFT.printf("BP starts in") ;
nikitateggi 7:11f926351d8f 305 for(int i=5;i>=0;i--)
suhasini 6:5e33a0f01476 306 {
suhasini 6:5e33a0f01476 307 wait(1);
suhasini 6:5e33a0f01476 308 sprintf (tim1, "%d",i);
nikitateggi 7:11f926351d8f 309 TFT.locate(120,120) ;
nikitateggi 7:11f926351d8f 310 TFT.printf(tim1) ;
suhasini 6:5e33a0f01476 311 }
nikitateggi 7:11f926351d8f 312 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 313 backlight = 1 ;
nikitateggi 7:11f926351d8f 314 }
nikitateggi 1:8316c23ec6b9 315
nikitateggi 4:6bd81bb1790d 316 void screen_again() // screen to press 'yes' or 'no' to repeat the test
nikitateggi 7:11f926351d8f 317 {
nikitateggi 7:11f926351d8f 318 backlight = 0 ;
nikitateggi 7:11f926351d8f 319 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 320 TFT.background(White) ;
nikitateggi 7:11f926351d8f 321 TFT.foreground(Black) ;
nikitateggi 7:11f926351d8f 322 TFT.fillrect(5,127,230,200,White);
nikitateggi 7:11f926351d8f 323 TFT.locate(50,130) ;
nikitateggi 7:11f926351d8f 324 TFT.printf("Take test") ;
nikitateggi 7:11f926351d8f 325 TFT.locate(75,160) ;
nikitateggi 7:11f926351d8f 326 TFT.printf("again?") ;
nikitateggi 7:11f926351d8f 327 TFT.background(Orange) ;
nikitateggi 7:11f926351d8f 328 TFT.locate(30,245) ;
nikitateggi 7:11f926351d8f 329 TFT.printf("YES") ;
nikitateggi 7:11f926351d8f 330 TFT.locate(135,245) ;
nikitateggi 7:11f926351d8f 331 TFT.printf(" NO ") ;
nikitateggi 7:11f926351d8f 332 backlight = 1 ;
nikitateggi 7:11f926351d8f 333 TFT.BusEnable(false) ;
nikitateggi 3:9a06c2bed650 334
nikitateggi 1:8316c23ec6b9 335 }
nikitateggi 1:8316c23ec6b9 336
nikitateggi 1:8316c23ec6b9 337
nikitateggi 4:6bd81bb1790d 338 void screen_glc_2() // GLC screen 3 after test
nikitateggi 1:8316c23ec6b9 339 {
nikitateggi 3:9a06c2bed650 340
nikitateggi 7:11f926351d8f 341 backlight = 0 ;
nikitateggi 7:11f926351d8f 342 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 343 TFT.background(White) ;
nikitateggi 7:11f926351d8f 344 TFT.foreground(Black) ;
nikitateggi 7:11f926351d8f 345 TFT.fillrect(5,127,230,320,White);
nikitateggi 7:11f926351d8f 346 TFT.fillrect(60,230,180,300,Green);
nikitateggi 7:11f926351d8f 347 TFT.locate(85,250) ;
nikitateggi 7:11f926351d8f 348 TFT.background(Green);
nikitateggi 7:11f926351d8f 349 TFT.printf("RET") ;
nikitateggi 7:11f926351d8f 350 backlight = 1 ;
nikitateggi 7:11f926351d8f 351 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 352
nikitateggi 7:11f926351d8f 353
nikitateggi 7:11f926351d8f 354
nikitateggi 1:8316c23ec6b9 355 }
nikitateggi 1:8316c23ec6b9 356
nikitateggi 4:6bd81bb1790d 357
nikitateggi 4:6bd81bb1790d 358 void glc_1() // GLC screen
nikitateggi 7:11f926351d8f 359 {
nikitateggi 7:11f926351d8f 360 backlight = 0 ;
nikitateggi 7:11f926351d8f 361 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 362 TFT.background(White) ;
nikitateggi 7:11f926351d8f 363 TFT.foreground(Magenta ) ;
nikitateggi 7:11f926351d8f 364 TFT.fillrect(3,130,200,200,White);
nikitateggi 7:11f926351d8f 365 TFT.fillrect(60,230,180,300,White);
nikitateggi 7:11f926351d8f 366 TFT.fillrect(5,215,230,290,White);
nikitateggi 7:11f926351d8f 367 TFT.locate(5,130) ;
nikitateggi 7:11f926351d8f 368 TFT.printf("Blood Glucose") ;
nikitateggi 7:11f926351d8f 369 TFT.locate(5,160) ;
nikitateggi 7:11f926351d8f 370 TFT.printf("Insert strip") ;
nikitateggi 7:11f926351d8f 371 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 372 backlight = 1 ;
nikitateggi 7:11f926351d8f 373
nikitateggi 7:11f926351d8f 374
nikitateggi 7:11f926351d8f 375
nikitateggi 1:8316c23ec6b9 376 }
nikitateggi 1:8316c23ec6b9 377
nikitateggi 4:6bd81bb1790d 378 void glc_2() // GLC screen
nikitateggi 1:8316c23ec6b9 379 {
nikitateggi 7:11f926351d8f 380 backlight = 0 ;
nikitateggi 7:11f926351d8f 381 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 382 TFT.locate(5,160) ;
nikitateggi 7:11f926351d8f 383 TFT.printf("Strip Detected") ;
nikitateggi 7:11f926351d8f 384 TFT.locate(5,190) ;
nikitateggi 7:11f926351d8f 385 TFT.printf("Insert Blood") ;
nikitateggi 7:11f926351d8f 386 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 387 backlight = 1 ;
nikitateggi 1:8316c23ec6b9 388 }
nikitateggi 0:c47fb0c1bbf6 389
nikitateggi 4:6bd81bb1790d 390
nikitateggi 4:6bd81bb1790d 391 void glc_3() // GLC screen
nikitateggi 1:8316c23ec6b9 392 {
nikitateggi 7:11f926351d8f 393 backlight = 0 ;
nikitateggi 7:11f926351d8f 394 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 395 TFT.locate(5,190) ;
nikitateggi 7:11f926351d8f 396 TFT.printf("Blood Detected") ;
nikitateggi 7:11f926351d8f 397 TFT.locate( 5,220) ;
nikitateggi 7:11f926351d8f 398 TFT.printf("computing") ;
nikitateggi 7:11f926351d8f 399 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 400 backlight = 1 ;
nikitateggi 7:11f926351d8f 401 }
nikitateggi 1:8316c23ec6b9 402
nikitateggi 4:6bd81bb1790d 403
nidhinvarghese 15:208b146151ba 404 void glc_4(uint16_t mgdl) // GLC screen to display blood glucose level on the LCD
nikitateggi 7:11f926351d8f 405 {
nikitateggi 7:11f926351d8f 406 char buf[10];
nikitateggi 4:6bd81bb1790d 407 sprintf (buf, " BG %d mg/dl",mgdl);
nikitateggi 7:11f926351d8f 408 backlight = 0 ;
nikitateggi 7:11f926351d8f 409 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 410 TFT.fillrect(5,127,230,320,White);
nikitateggi 7:11f926351d8f 411 TFT.locate(5,100) ;
nikitateggi 7:11f926351d8f 412 TFT.printf(buf) ;
nikitateggi 7:11f926351d8f 413 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 414 backlight = 1 ;
nikitateggi 1:8316c23ec6b9 415 }