export test

Dependencies:   SDFileSystem ds3231 eeprom_Nikita mbed testUniGraphic_150217

Fork of Int_Demo_09May2017_Suhasini_HRavg_Nikita_ili9341 by nikita teggi

Committer:
pietrodizinno
Date:
Fri Mar 02 13:56:33 2018 +0000
Revision:
31:37d3ae1fa1eb
Parent:
29:7edc76b15e3d
export test

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