Fix all the following issues which we faced during 01st April internal demo 1) Display hang and jump issue 2) Sequencing issue 3) Issue with BP code

Dependencies:   SDFileSystem ds3231 program mbed testUniGraphic_150217

Fork of Int_Demo_01Apr2017_newdisplaycode_bp_nikita by nikita teggi

Committer:
nikitateggi
Date:
Mon May 08 05:19:22 2017 +0000
Revision:
12:ab85607bb10a
Parent:
10:aeff3309002a
POC code with new display and updated BP

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
nikitateggi 4:6bd81bb1790d 157 void screen_ecg_2() // ECG screen 2
nikitateggi 1:8316c23ec6b9 158 {
nikitateggi 7:11f926351d8f 159 backlight = 0 ;
nikitateggi 7:11f926351d8f 160 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 161 TFT.background(White) ;
nikitateggi 7:11f926351d8f 162 TFT.foreground(Green) ;
nikitateggi 7:11f926351d8f 163
nikitateggi 7:11f926351d8f 164 TFT.fillrect(5,90,230,150,White);
nikitateggi 7:11f926351d8f 165 TFT.locate(3,100) ;
nikitateggi 7:11f926351d8f 166 TFT.printf(" Tst is Done ") ;
nikitateggi 7:11f926351d8f 167 TFT.locate(3,150) ;
nikitateggi 7:11f926351d8f 168 TFT.printf(" HeartRate ") ;
nikitateggi 7:11f926351d8f 169 TFT.locate(3,180);
nikitateggi 7:11f926351d8f 170 TFT.printf(" 72 bpm") ;
nikitateggi 7:11f926351d8f 171 TFT.background(Green) ;
nikitateggi 7:11f926351d8f 172 TFT.fillrect(10,215,230,290,White);
nikitateggi 7:11f926351d8f 173 TFT.fillrect(60,230,180,300,Green);
nikitateggi 7:11f926351d8f 174 TFT.locate(100,250) ;
nikitateggi 7:11f926351d8f 175 TFT.foreground(Black) ;
nikitateggi 7:11f926351d8f 176 TFT.printf("RET") ;
nikitateggi 7:11f926351d8f 177 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 178 backlight = 1 ;
nikitateggi 3:9a06c2bed650 179
nikitateggi 1:8316c23ec6b9 180 }
nikitateggi 1:8316c23ec6b9 181
nikitateggi 1:8316c23ec6b9 182
nikitateggi 0:c47fb0c1bbf6 183
nikitateggi 4:6bd81bb1790d 184 void screen_bp() // BP main screen
nikitateggi 0:c47fb0c1bbf6 185 {
nikitateggi 7:11f926351d8f 186 backlight = 0 ;
nikitateggi 7:11f926351d8f 187 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 188 TFT.background(Green) ;
nikitateggi 7:11f926351d8f 189 TFT.foreground(Black) ;
nikitateggi 7:11f926351d8f 190 TFT.fillrect(10,130,100,200,White);
nikitateggi 7:11f926351d8f 191 TFT.fillrect(130,130,220,200,White);
nikitateggi 7:11f926351d8f 192 TFT.fillrect(10,215,100,285,White);
nikitateggi 7:11f926351d8f 193 TFT.fillrect(130,215,220,285,White);
nikitateggi 7:11f926351d8f 194 TFT.fillrect( 60,130,180,200,Green);
nikitateggi 7:11f926351d8f 195 TFT.locate(80,150) ;
nikitateggi 7:11f926351d8f 196 TFT.printf("START") ;
nikitateggi 7:11f926351d8f 197 TFT.fillrect( 60,230,180,300,Green);
nikitateggi 7:11f926351d8f 198 TFT.locate(100,250) ;
nikitateggi 7:11f926351d8f 199 TFT.printf("RET") ;
nikitateggi 7:11f926351d8f 200 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 201 backlight = 1 ;
nikitateggi 3:9a06c2bed650 202
nikitateggi 3:9a06c2bed650 203 }
nikitateggi 3:9a06c2bed650 204
nikitateggi 4:6bd81bb1790d 205
nikitateggi 4:6bd81bb1790d 206 void screen_bp1(float SBP, float DBP) // BP screen 2
nikitateggi 3:9a06c2bed650 207 {
nikitateggi 7:11f926351d8f 208 backlight = 0 ;
nikitateggi 7:11f926351d8f 209 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 210 TFT.background(White) ;
nikitateggi 7:11f926351d8f 211 TFT.foreground(Green) ;
nikitateggi 7:11f926351d8f 212 char buf[10];
nikitateggi 9:d0ecb61d219e 213 TFT.fillrect(3,130,200,200,White);
nikitateggi 9:d0ecb61d219e 214 TFT.fillrect(60,230,180,300,White);
nidhinvarghese 10:aeff3309002a 215 sprintf (buf, "SBP: %.0f ",SBP); // changed to display 2 digits after decimal point, 2May'17 Changed to Integer
nikitateggi 7:11f926351d8f 216 TFT.locate(5,100) ;
nikitateggi 7:11f926351d8f 217 TFT.printf(buf) ;
nidhinvarghese 10:aeff3309002a 218 sprintf (buf, "DBP: %.0f",DBP); // changed to display 2 digits after decimal point, 2May'17, Changed to integer
nikitateggi 7:11f926351d8f 219 TFT.locate(5,150) ;
nikitateggi 7:11f926351d8f 220 TFT.printf(buf) ;
nikitateggi 7:11f926351d8f 221 TFT.fillrect(60,230,180,300,Green);
nikitateggi 7:11f926351d8f 222 TFT.locate(85,250) ;
nikitateggi 7:11f926351d8f 223 TFT.foreground(Black) ;
nikitateggi 9:d0ecb61d219e 224 TFT.background(Green) ;
nikitateggi 7:11f926351d8f 225 TFT.printf("RET") ;
nikitateggi 7:11f926351d8f 226 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 227 backlight = 1 ;
nikitateggi 3:9a06c2bed650 228 }
nikitateggi 3:9a06c2bed650 229
nikitateggi 3:9a06c2bed650 230
nikitateggi 3:9a06c2bed650 231
nikitateggi 0:c47fb0c1bbf6 232
nikitateggi 0:c47fb0c1bbf6 233
nikitateggi 1:8316c23ec6b9 234 void screen_glc() // glc main screen
nikitateggi 0:c47fb0c1bbf6 235 {
nikitateggi 3:9a06c2bed650 236
nikitateggi 7:11f926351d8f 237 backlight = 0 ;
nikitateggi 7:11f926351d8f 238 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 239 TFT.background(Green) ;
nikitateggi 7:11f926351d8f 240 TFT.foreground(Black) ;
nikitateggi 7:11f926351d8f 241 TFT.fillrect(10,130,100,200,White);
nikitateggi 7:11f926351d8f 242 TFT.fillrect(130,130,220,200,White);
nikitateggi 7:11f926351d8f 243 TFT.fillrect(10,215,100,285,White);
nikitateggi 7:11f926351d8f 244 TFT.fillrect(130,215,220,285,White);
nikitateggi 7:11f926351d8f 245 TFT.fillrect( 60,130,180,200,Green);
nikitateggi 7:11f926351d8f 246 TFT.locate(80,150) ;
nikitateggi 7:11f926351d8f 247 TFT.printf("START") ;
nikitateggi 7:11f926351d8f 248 TFT.fillrect( 60,230,180,300,Green);
nikitateggi 7:11f926351d8f 249 TFT.locate(100,250) ;
nikitateggi 7:11f926351d8f 250 TFT.printf("RET") ;
nikitateggi 7:11f926351d8f 251 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 252 backlight = 1 ;
nikitateggi 3:9a06c2bed650 253
nikitateggi 0:c47fb0c1bbf6 254 }
nikitateggi 0:c47fb0c1bbf6 255
nikitateggi 4:6bd81bb1790d 256
nikitateggi 4:6bd81bb1790d 257 void screen_bp2() //BP screen 3
nikitateggi 3:9a06c2bed650 258 {
nikitateggi 3:9a06c2bed650 259
nikitateggi 7:11f926351d8f 260 /* lcd.FillRoundRect(3,130,200,200,COLOR_BLACK);
nikitateggi 3:9a06c2bed650 261 lcd.FillRoundRect(60,230,180,300,COLOR_BLACK);
nikitateggi 7:11f926351d8f 262 lcd.FillRect(5,215,230,290,COLOR_BLACK);*/
nikitateggi 3:9a06c2bed650 263
nikitateggi 3:9a06c2bed650 264 }
nikitateggi 1:8316c23ec6b9 265
nikitateggi 1:8316c23ec6b9 266
nikitateggi 4:6bd81bb1790d 267 void ecg_countdown() // ECG measurement countdown
nikitateggi 1:8316c23ec6b9 268 {
nikitateggi 7:11f926351d8f 269 backlight = 0 ;
nikitateggi 7:11f926351d8f 270 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 271 TFT.background(White) ;
nikitateggi 7:11f926351d8f 272 TFT.foreground(Green) ;
nikitateggi 7:11f926351d8f 273 char tim1[5];
nikitateggi 7:11f926351d8f 274 TFT.fillrect(3,130,200,200,White);
nikitateggi 7:11f926351d8f 275 TFT.fillrect(60,230,180,300,White);
nikitateggi 7:11f926351d8f 276 TFT.fillrect(5,215,230,290,White);
nikitateggi 7:11f926351d8f 277 TFT.locate(25,100) ;
nikitateggi 7:11f926351d8f 278 TFT.printf("ECG starts in") ;
nikitateggi 7:11f926351d8f 279 for(int i=5;i>=0;i--)
nikitateggi 1:8316c23ec6b9 280 {
nikitateggi 1:8316c23ec6b9 281 wait(1);
nikitateggi 1:8316c23ec6b9 282 sprintf (tim1, "%d",i);
nikitateggi 7:11f926351d8f 283 TFT.locate(120,120) ;
nikitateggi 7:11f926351d8f 284 TFT.printf(tim1) ;
nikitateggi 1:8316c23ec6b9 285 }
nikitateggi 7:11f926351d8f 286 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 287 backlight = 1 ;
nikitateggi 7:11f926351d8f 288
nikitateggi 3:9a06c2bed650 289
nikitateggi 1:8316c23ec6b9 290 }
nikitateggi 1:8316c23ec6b9 291
suhasini 6:5e33a0f01476 292 void bp_countdown() // ECG measurement countdown
suhasini 6:5e33a0f01476 293 {
nikitateggi 7:11f926351d8f 294 backlight = 0 ;
nikitateggi 7:11f926351d8f 295 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 296 TFT.background(White) ;
nikitateggi 7:11f926351d8f 297 TFT.foreground(Green) ;
nikitateggi 7:11f926351d8f 298 char tim1[5];
nikitateggi 7:11f926351d8f 299 TFT.fillrect(3,130,200,200,White);
nikitateggi 7:11f926351d8f 300 TFT.fillrect(60,230,180,300,White);
nikitateggi 7:11f926351d8f 301 TFT.fillrect(5,215,230,290,White);
nikitateggi 7:11f926351d8f 302 TFT.locate(25,100) ;
nikitateggi 7:11f926351d8f 303 TFT.printf("BP starts in") ;
nikitateggi 7:11f926351d8f 304 for(int i=5;i>=0;i--)
suhasini 6:5e33a0f01476 305 {
suhasini 6:5e33a0f01476 306 wait(1);
suhasini 6:5e33a0f01476 307 sprintf (tim1, "%d",i);
nikitateggi 7:11f926351d8f 308 TFT.locate(120,120) ;
nikitateggi 7:11f926351d8f 309 TFT.printf(tim1) ;
suhasini 6:5e33a0f01476 310 }
nikitateggi 7:11f926351d8f 311 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 312 backlight = 1 ;
nikitateggi 7:11f926351d8f 313 }
nikitateggi 1:8316c23ec6b9 314
nikitateggi 4:6bd81bb1790d 315 void screen_again() // screen to press 'yes' or 'no' to repeat the test
nikitateggi 7:11f926351d8f 316 {
nikitateggi 7:11f926351d8f 317 backlight = 0 ;
nikitateggi 7:11f926351d8f 318 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 319 TFT.background(White) ;
nikitateggi 7:11f926351d8f 320 TFT.foreground(Black) ;
nikitateggi 7:11f926351d8f 321 TFT.fillrect(5,127,230,200,White);
nikitateggi 7:11f926351d8f 322 TFT.locate(50,130) ;
nikitateggi 7:11f926351d8f 323 TFT.printf("Take test") ;
nikitateggi 7:11f926351d8f 324 TFT.locate(75,160) ;
nikitateggi 7:11f926351d8f 325 TFT.printf("again?") ;
nikitateggi 7:11f926351d8f 326 TFT.background(Orange) ;
nikitateggi 7:11f926351d8f 327 TFT.locate(30,245) ;
nikitateggi 7:11f926351d8f 328 TFT.printf("YES") ;
nikitateggi 7:11f926351d8f 329 TFT.locate(135,245) ;
nikitateggi 7:11f926351d8f 330 TFT.printf(" NO ") ;
nikitateggi 7:11f926351d8f 331 backlight = 1 ;
nikitateggi 7:11f926351d8f 332 TFT.BusEnable(false) ;
nikitateggi 3:9a06c2bed650 333
nikitateggi 1:8316c23ec6b9 334 }
nikitateggi 1:8316c23ec6b9 335
nikitateggi 1:8316c23ec6b9 336
nikitateggi 4:6bd81bb1790d 337 void screen_glc_2() // GLC screen 3 after test
nikitateggi 1:8316c23ec6b9 338 {
nikitateggi 3:9a06c2bed650 339
nikitateggi 7:11f926351d8f 340 backlight = 0 ;
nikitateggi 7:11f926351d8f 341 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 342 TFT.background(White) ;
nikitateggi 7:11f926351d8f 343 TFT.foreground(Black) ;
nikitateggi 7:11f926351d8f 344 TFT.fillrect(5,127,230,320,White);
nikitateggi 7:11f926351d8f 345 TFT.fillrect(60,230,180,300,Green);
nikitateggi 7:11f926351d8f 346 TFT.locate(85,250) ;
nikitateggi 7:11f926351d8f 347 TFT.background(Green);
nikitateggi 7:11f926351d8f 348 TFT.printf("RET") ;
nikitateggi 7:11f926351d8f 349 backlight = 1 ;
nikitateggi 7:11f926351d8f 350 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 351
nikitateggi 7:11f926351d8f 352
nikitateggi 7:11f926351d8f 353
nikitateggi 1:8316c23ec6b9 354 }
nikitateggi 1:8316c23ec6b9 355
nikitateggi 4:6bd81bb1790d 356
nikitateggi 4:6bd81bb1790d 357 void glc_1() // GLC screen
nikitateggi 7:11f926351d8f 358 {
nikitateggi 7:11f926351d8f 359 backlight = 0 ;
nikitateggi 7:11f926351d8f 360 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 361 TFT.background(White) ;
nikitateggi 7:11f926351d8f 362 TFT.foreground(Magenta ) ;
nikitateggi 7:11f926351d8f 363 TFT.fillrect(3,130,200,200,White);
nikitateggi 7:11f926351d8f 364 TFT.fillrect(60,230,180,300,White);
nikitateggi 7:11f926351d8f 365 TFT.fillrect(5,215,230,290,White);
nikitateggi 7:11f926351d8f 366 TFT.locate(5,130) ;
nikitateggi 7:11f926351d8f 367 TFT.printf("Blood Glucose") ;
nikitateggi 7:11f926351d8f 368 TFT.locate(5,160) ;
nikitateggi 7:11f926351d8f 369 TFT.printf("Insert strip") ;
nikitateggi 7:11f926351d8f 370 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 371 backlight = 1 ;
nikitateggi 7:11f926351d8f 372
nikitateggi 7:11f926351d8f 373
nikitateggi 7:11f926351d8f 374
nikitateggi 1:8316c23ec6b9 375 }
nikitateggi 1:8316c23ec6b9 376
nikitateggi 4:6bd81bb1790d 377 void glc_2() // GLC screen
nikitateggi 1:8316c23ec6b9 378 {
nikitateggi 7:11f926351d8f 379 backlight = 0 ;
nikitateggi 7:11f926351d8f 380 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 381 TFT.locate(5,160) ;
nikitateggi 7:11f926351d8f 382 TFT.printf("Strip Detected") ;
nikitateggi 7:11f926351d8f 383 TFT.locate(5,190) ;
nikitateggi 7:11f926351d8f 384 TFT.printf("Insert Blood") ;
nikitateggi 7:11f926351d8f 385 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 386 backlight = 1 ;
nikitateggi 1:8316c23ec6b9 387 }
nikitateggi 0:c47fb0c1bbf6 388
nikitateggi 4:6bd81bb1790d 389
nikitateggi 4:6bd81bb1790d 390 void glc_3() // GLC screen
nikitateggi 1:8316c23ec6b9 391 {
nikitateggi 7:11f926351d8f 392 backlight = 0 ;
nikitateggi 7:11f926351d8f 393 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 394 TFT.locate(5,190) ;
nikitateggi 7:11f926351d8f 395 TFT.printf("Blood Detected") ;
nikitateggi 7:11f926351d8f 396 TFT.locate( 5,220) ;
nikitateggi 7:11f926351d8f 397 TFT.printf("computing") ;
nikitateggi 7:11f926351d8f 398 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 399 backlight = 1 ;
nikitateggi 7:11f926351d8f 400 }
nikitateggi 1:8316c23ec6b9 401
nikitateggi 4:6bd81bb1790d 402
nikitateggi 4:6bd81bb1790d 403 void glc_4(unsigned int mgdl) // GLC screen to display blood glucose level on the LCD
nikitateggi 7:11f926351d8f 404 {
nikitateggi 7:11f926351d8f 405 char buf[10];
nikitateggi 4:6bd81bb1790d 406 sprintf (buf, " BG %d mg/dl",mgdl);
nikitateggi 7:11f926351d8f 407 backlight = 0 ;
nikitateggi 7:11f926351d8f 408 TFT.BusEnable(true) ;
nikitateggi 7:11f926351d8f 409 TFT.fillrect(5,127,230,320,White);
nikitateggi 7:11f926351d8f 410 TFT.locate(5,100) ;
nikitateggi 7:11f926351d8f 411 TFT.printf(buf) ;
nikitateggi 7:11f926351d8f 412 TFT.BusEnable(false) ;
nikitateggi 7:11f926351d8f 413 backlight = 1 ;
nikitateggi 1:8316c23ec6b9 414 }