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:
Wed Apr 26 10:14:53 2017 +0000
Revision:
7:11f926351d8f
Parent:
6:5e33a0f01476
Child:
9:d0ecb61d219e
Poc code with unigraphic display

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