![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
k
Dependencies: mbed MFRC522 UniGraphic
main.cpp@11:7f4df462b2a5, 2018-12-18 (annotated)
- Committer:
- cakejohnn
- Date:
- Tue Dec 18 12:42:00 2018 +0000
- Revision:
- 11:7f4df462b2a5
- Parent:
- 10:2985dc4e40a5
m
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Geremia | 0:2ccd65a72ab8 | 1 | #include "stdio.h" |
Geremia | 0:2ccd65a72ab8 | 2 | #include "mbed.h" |
Geremia | 0:2ccd65a72ab8 | 3 | #include "string" |
Geremia | 0:2ccd65a72ab8 | 4 | #include "Arial12x12.h" |
Geremia | 0:2ccd65a72ab8 | 5 | #include "Arial24x23.h" |
saiagard | 7:81f1c4fae022 | 6 | #include "Arial28x28.h" |
Geremia | 0:2ccd65a72ab8 | 7 | #include "Arial43x48_numb.h" |
Geremia | 0:2ccd65a72ab8 | 8 | #include "pict.h" |
Geremia | 4:818956c30cae | 9 | #include "pavement_48x34.h" |
saiagard | 7:81f1c4fae022 | 10 | #include "TFT_MIPI.h" |
saiagard | 7:81f1c4fae022 | 11 | #include "SDFileSystem.h" |
khimAS | 9:914f2ea246bc | 12 | #include "MFRC522.h" |
khimAS | 9:914f2ea246bc | 13 | #define MF_RESET PC_6 |
saiagard | 7:81f1c4fae022 | 14 | Serial pc(SERIAL_TX, SERIAL_RX); |
cakejohnn | 11:7f4df462b2a5 | 15 | Serial esp(PA_15,PB_7); |
khimAS | 9:914f2ea246bc | 16 | MFRC522 RfChip (SPI_MOSI, SPI_MISO, SPI_SCK, SPI_CS, MF_RESET); |
saiagard | 7:81f1c4fae022 | 17 | PinName buspins[] = { PA_9, PC_7, PA_10, PB_3, PB_5, PB_4, PB_10, PA_8 }; |
saiagard | 7:81f1c4fae022 | 18 | TFT_MIPI myLCD(BUS_8, buspins, A3, A4, A2, A1, A0, "myLCD"); |
saiagard | 7:81f1c4fae022 | 19 | DigitalIn Sw[] = {PB_13, PB_14, PB_15, PB_2, PB_12,PA_11 }; |
Geremia | 0:2ccd65a72ab8 | 20 | Timer t; |
Geremia | 0:2ccd65a72ab8 | 21 | |
saiagard | 7:81f1c4fae022 | 22 | unsigned short backgroundcolor=Orange; |
saiagard | 7:81f1c4fae022 | 23 | unsigned short foregroundcolor=Black; |
Geremia | 0:2ccd65a72ab8 | 24 | char orient=1; |
saiagard | 7:81f1c4fae022 | 25 | int i=0; |
saiagard | 7:81f1c4fae022 | 26 | int j=0; |
Palm2NOPY | 8:2bcc87bbd034 | 27 | int k=0; |
khimAS | 9:914f2ea246bc | 28 | int Pagejawjiw = 0; |
saiagard | 7:81f1c4fae022 | 29 | int state = 0; |
cakejohnn | 11:7f4df462b2a5 | 30 | int typeA = 0; |
cakejohnn | 11:7f4df462b2a5 | 31 | int typeB = 0; |
cakejohnn | 11:7f4df462b2a5 | 32 | int typeC = 0; |
cakejohnn | 11:7f4df462b2a5 | 33 | int typeD = 0; |
cakejohnn | 11:7f4df462b2a5 | 34 | int queueA = 0; |
cakejohnn | 11:7f4df462b2a5 | 35 | int queueB = 0; |
cakejohnn | 11:7f4df462b2a5 | 36 | int queueC = 0; |
cakejohnn | 11:7f4df462b2a5 | 37 | int queueD = 0; |
khimAS | 10:2985dc4e40a5 | 38 | int main(){ |
cakejohnn | 11:7f4df462b2a5 | 39 | pc.baud(9600); |
cakejohnn | 11:7f4df462b2a5 | 40 | esp.baud(9600); |
khimAS | 9:914f2ea246bc | 41 | char *StudentID; |
khimAS | 9:914f2ea246bc | 42 | uint8_t UIDCard[4]={}; |
khimAS | 9:914f2ea246bc | 43 | pc.printf("starting...\n"); |
khimAS | 9:914f2ea246bc | 44 | RfChip.PCD_Init(); |
khimAS | 9:914f2ea246bc | 45 | |
Geremia | 4:818956c30cae | 46 | myLCD.set_orientation(orient); |
saiagard | 7:81f1c4fae022 | 47 | int time; |
Geremia | 0:2ccd65a72ab8 | 48 | t.start(); |
saiagard | 7:81f1c4fae022 | 49 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 50 | myLCD.foreground(foregroundcolor); |
Geremia | 4:818956c30cae | 51 | myLCD.cls(); |
Geremia | 0:2ccd65a72ab8 | 52 | |
khimAS | 9:914f2ea246bc | 53 | while(1){ |
khimAS | 9:914f2ea246bc | 54 | if(Pagejawjiw == 0){ |
khimAS | 9:914f2ea246bc | 55 | myLCD.background(backgroundcolor); |
khimAS | 9:914f2ea246bc | 56 | myLCD.foreground(foregroundcolor); |
khimAS | 9:914f2ea246bc | 57 | myLCD.Bitmap(150,45,180,180,data); |
khimAS | 9:914f2ea246bc | 58 | myLCD.fillrect(0,320,500,280,Orange); |
khimAS | 9:914f2ea246bc | 59 | time=t.read_us(); |
khimAS | 10:2985dc4e40a5 | 60 | if(! RfChip.PICC_IsNewCardPresent()){ |
khimAS | 10:2985dc4e40a5 | 61 | pc.printf("GOOOOOOOOO\n"); |
khimAS | 10:2985dc4e40a5 | 62 | for(int i=200; i<=200;i++){ |
khimAS | 9:914f2ea246bc | 63 | myLCD.locate(i,295); |
khimAS | 9:914f2ea246bc | 64 | myLCD.set_font((unsigned char*) Arial12x12); |
khimAS | 10:2985dc4e40a5 | 65 | myLCD.printf("Please scan your Student ID card to start.");} |
khimAS | 10:2985dc4e40a5 | 66 | for(int i=200; i>=2;i--){ |
khimAS | 9:914f2ea246bc | 67 | myLCD.locate(i,295); |
khimAS | 9:914f2ea246bc | 68 | myLCD.set_font((unsigned char*) Arial12x12); |
khimAS | 10:2985dc4e40a5 | 69 | myLCD.printf("Please scan your Student ID card to start.");} |
khimAS | 10:2985dc4e40a5 | 70 | continue;} |
khimAS | 10:2985dc4e40a5 | 71 | if ( ! RfChip.PICC_ReadCardSerial()){pc.printf("!!!!!!!!!!!!!!!");continue;} |
khimAS | 9:914f2ea246bc | 72 | pc.printf("Studen's ID: "); |
khimAS | 9:914f2ea246bc | 73 | for (uint8_t i = 0; i < RfChip.uid.size; i++){UIDCard[i] = RfChip.uid.uidByte[i];} |
cakejohnn | 11:7f4df462b2a5 | 74 | if (UIDCard[0]==187 and UIDCard[1]==164 and UIDCard[2]==90 and UIDCard[3]==127){StudentID = "60340500033"; |
cakejohnn | 11:7f4df462b2a5 | 75 | pc.printf("%s\n",StudentID);Pagejawjiw = 1;myLCD.cls(); |
cakejohnn | 11:7f4df462b2a5 | 76 | char b[] = "X"; |
cakejohnn | 11:7f4df462b2a5 | 77 | esp.putc(b[0]); |
cakejohnn | 11:7f4df462b2a5 | 78 | } |
cakejohnn | 11:7f4df462b2a5 | 79 | |
cakejohnn | 11:7f4df462b2a5 | 80 | else if (UIDCard[0]==60 and UIDCard[1]==135 and UIDCard[2]==56 and UIDCard[3]==59){StudentID = "60340500066"; |
cakejohnn | 11:7f4df462b2a5 | 81 | pc.printf("%s\n",StudentID);Pagejawjiw = 0; |
cakejohnn | 11:7f4df462b2a5 | 82 | char b[] = "Y"; |
cakejohnn | 11:7f4df462b2a5 | 83 | esp.putc(b[0]); |
cakejohnn | 11:7f4df462b2a5 | 84 | } |
khimAS | 9:914f2ea246bc | 85 | else {StudentID="0"; pc.printf("%s\n",StudentID);} |
khimAS | 9:914f2ea246bc | 86 | } |
khimAS | 9:914f2ea246bc | 87 | else if (Pagejawjiw == 1) { |
saiagard | 7:81f1c4fae022 | 88 | if(i == 0 or Sw[2] == 0){ |
saiagard | 7:81f1c4fae022 | 89 | i++; |
saiagard | 7:81f1c4fae022 | 90 | switch(i){ |
saiagard | 7:81f1c4fae022 | 91 | case 1: |
cakejohnn | 11:7f4df462b2a5 | 92 | typeA = 1; |
saiagard | 7:81f1c4fae022 | 93 | myLCD.fillrect(0,0,500,50,Orange); |
saiagard | 7:81f1c4fae022 | 94 | myLCD.rect(155,70,320,120,Orange); |
saiagard | 7:81f1c4fae022 | 95 | myLCD.rect(155,130,320,180,Orange); |
saiagard | 7:81f1c4fae022 | 96 | myLCD.rect(155,190,320,240,Orange); |
saiagard | 7:81f1c4fae022 | 97 | myLCD.rect(155,250,320,300,Orange); |
saiagard | 7:81f1c4fae022 | 98 | myLCD.set_font((unsigned char*) Arial28x28); |
saiagard | 7:81f1c4fae022 | 99 | myLCD.locate(160,15); |
saiagard | 7:81f1c4fae022 | 100 | myLCD.background(Orange); |
saiagard | 7:81f1c4fae022 | 101 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 102 | myLCD.printf("Select Mode"); |
saiagard | 7:81f1c4fae022 | 103 | myLCD.set_font((unsigned char*) Arial24x23); |
saiagard | 7:81f1c4fae022 | 104 | myLCD.locate(162,85); |
saiagard | 7:81f1c4fae022 | 105 | myLCD.background(Yellow); |
saiagard | 7:81f1c4fae022 | 106 | myLCD.foreground(Green); |
saiagard | 7:81f1c4fae022 | 107 | myLCD.printf(" Document"); |
saiagard | 7:81f1c4fae022 | 108 | myLCD.locate(187,145); |
saiagard | 7:81f1c4fae022 | 109 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 110 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 111 | myLCD.printf("ID Card"); |
saiagard | 7:81f1c4fae022 | 112 | myLCD.locate(177,205); |
saiagard | 7:81f1c4fae022 | 113 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 114 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 115 | myLCD.printf("Financial"); |
saiagard | 7:81f1c4fae022 | 116 | myLCD.locate(202,265); |
saiagard | 7:81f1c4fae022 | 117 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 118 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 119 | myLCD.printf("Other"); |
saiagard | 7:81f1c4fae022 | 120 | wait(0.3); |
saiagard | 7:81f1c4fae022 | 121 | break; |
cakejohnn | 11:7f4df462b2a5 | 122 | case 2: |
cakejohnn | 11:7f4df462b2a5 | 123 | typeB = 2; |
saiagard | 7:81f1c4fae022 | 124 | //myLCD.cls(); |
saiagard | 7:81f1c4fae022 | 125 | myLCD.fillrect(0,0,500,50,Orange); |
saiagard | 7:81f1c4fae022 | 126 | myLCD.rect(155,70,320,120,Orange); |
saiagard | 7:81f1c4fae022 | 127 | myLCD.rect(155,130,320,180,Orange); |
saiagard | 7:81f1c4fae022 | 128 | myLCD.rect(155,190,320,240,Orange); |
saiagard | 7:81f1c4fae022 | 129 | myLCD.rect(155,250,320,300,Orange); |
saiagard | 7:81f1c4fae022 | 130 | myLCD.set_font((unsigned char*) Arial28x28); |
saiagard | 7:81f1c4fae022 | 131 | myLCD.locate(160,15); |
saiagard | 7:81f1c4fae022 | 132 | myLCD.background(Orange); |
saiagard | 7:81f1c4fae022 | 133 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 134 | myLCD.printf("Select Mode"); |
saiagard | 7:81f1c4fae022 | 135 | myLCD.set_font((unsigned char*) Arial24x23); |
saiagard | 7:81f1c4fae022 | 136 | myLCD.locate(162,85); |
saiagard | 7:81f1c4fae022 | 137 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 138 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 139 | myLCD.printf(" Document"); |
saiagard | 7:81f1c4fae022 | 140 | myLCD.locate(187,145); |
saiagard | 7:81f1c4fae022 | 141 | myLCD.background(Yellow); |
saiagard | 7:81f1c4fae022 | 142 | myLCD.foreground(Green); |
saiagard | 7:81f1c4fae022 | 143 | myLCD.printf("ID Card"); |
saiagard | 7:81f1c4fae022 | 144 | myLCD.locate(177,205); |
saiagard | 7:81f1c4fae022 | 145 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 146 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 147 | myLCD.printf("Financial"); |
saiagard | 7:81f1c4fae022 | 148 | myLCD.locate(202,265); |
saiagard | 7:81f1c4fae022 | 149 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 150 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 151 | myLCD.printf("Other"); |
saiagard | 7:81f1c4fae022 | 152 | wait(0.3); |
saiagard | 7:81f1c4fae022 | 153 | break; |
saiagard | 7:81f1c4fae022 | 154 | case 3: |
cakejohnn | 11:7f4df462b2a5 | 155 | typeC = 3; |
saiagard | 7:81f1c4fae022 | 156 | myLCD.fillrect(0,0,500,50,Orange); |
saiagard | 7:81f1c4fae022 | 157 | myLCD.rect(155,70,320,120,Orange); |
saiagard | 7:81f1c4fae022 | 158 | myLCD.rect(155,130,320,180,Orange); |
saiagard | 7:81f1c4fae022 | 159 | myLCD.rect(155,190,320,240,Orange); |
saiagard | 7:81f1c4fae022 | 160 | myLCD.rect(155,250,320,300,Orange); |
saiagard | 7:81f1c4fae022 | 161 | myLCD.set_font((unsigned char*) Arial28x28); |
saiagard | 7:81f1c4fae022 | 162 | myLCD.locate(160,15); |
saiagard | 7:81f1c4fae022 | 163 | myLCD.background(Orange); |
saiagard | 7:81f1c4fae022 | 164 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 165 | myLCD.printf("Select Mode"); |
saiagard | 7:81f1c4fae022 | 166 | myLCD.set_font((unsigned char*) Arial24x23); |
saiagard | 7:81f1c4fae022 | 167 | myLCD.locate(162,85); |
saiagard | 7:81f1c4fae022 | 168 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 169 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 170 | myLCD.printf(" Document"); |
saiagard | 7:81f1c4fae022 | 171 | myLCD.locate(187,145); |
saiagard | 7:81f1c4fae022 | 172 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 173 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 174 | myLCD.printf("ID Card"); |
saiagard | 7:81f1c4fae022 | 175 | myLCD.locate(177,205); |
saiagard | 7:81f1c4fae022 | 176 | myLCD.background(Yellow); |
saiagard | 7:81f1c4fae022 | 177 | myLCD.foreground(Green); |
saiagard | 7:81f1c4fae022 | 178 | myLCD.printf("Financial"); |
saiagard | 7:81f1c4fae022 | 179 | myLCD.locate(202,265); |
saiagard | 7:81f1c4fae022 | 180 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 181 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 182 | myLCD.printf("Other"); |
saiagard | 7:81f1c4fae022 | 183 | wait(0.3); |
saiagard | 7:81f1c4fae022 | 184 | break; |
cakejohnn | 11:7f4df462b2a5 | 185 | case 4: |
cakejohnn | 11:7f4df462b2a5 | 186 | typeD = 4; |
saiagard | 7:81f1c4fae022 | 187 | myLCD.fillrect(0,0,500,50,Orange); |
saiagard | 7:81f1c4fae022 | 188 | myLCD.rect(155,70,320,120,Orange); |
saiagard | 7:81f1c4fae022 | 189 | myLCD.rect(155,130,320,180,Orange); |
saiagard | 7:81f1c4fae022 | 190 | myLCD.rect(155,190,320,240,Orange); |
saiagard | 7:81f1c4fae022 | 191 | myLCD.rect(155,250,320,300,Orange); |
saiagard | 7:81f1c4fae022 | 192 | myLCD.set_font((unsigned char*) Arial28x28); |
saiagard | 7:81f1c4fae022 | 193 | myLCD.locate(160,15); |
saiagard | 7:81f1c4fae022 | 194 | myLCD.background(Orange); |
saiagard | 7:81f1c4fae022 | 195 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 196 | myLCD.printf("Select Mode"); |
saiagard | 7:81f1c4fae022 | 197 | myLCD.set_font((unsigned char*) Arial24x23); |
saiagard | 7:81f1c4fae022 | 198 | myLCD.locate(162,85); |
saiagard | 7:81f1c4fae022 | 199 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 200 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 201 | myLCD.printf(" Document"); |
saiagard | 7:81f1c4fae022 | 202 | myLCD.locate(187,145); |
saiagard | 7:81f1c4fae022 | 203 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 204 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 205 | myLCD.printf("ID Card"); |
saiagard | 7:81f1c4fae022 | 206 | myLCD.locate(177,205); |
saiagard | 7:81f1c4fae022 | 207 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 208 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 209 | myLCD.printf("Financial"); |
saiagard | 7:81f1c4fae022 | 210 | myLCD.locate(202,265); |
saiagard | 7:81f1c4fae022 | 211 | myLCD.background(Yellow); |
saiagard | 7:81f1c4fae022 | 212 | myLCD.foreground(Green); |
saiagard | 7:81f1c4fae022 | 213 | myLCD.printf("Other"); |
saiagard | 7:81f1c4fae022 | 214 | wait(0.3); |
Palm2NOPY | 8:2bcc87bbd034 | 215 | break; |
Palm2NOPY | 8:2bcc87bbd034 | 216 | case 5: |
Palm2NOPY | 8:2bcc87bbd034 | 217 | i=0; |
saiagard | 7:81f1c4fae022 | 218 | break; |
saiagard | 7:81f1c4fae022 | 219 | } |
saiagard | 7:81f1c4fae022 | 220 | } |
saiagard | 7:81f1c4fae022 | 221 | else if(Sw[0] == 0){ |
saiagard | 7:81f1c4fae022 | 222 | i--; |
saiagard | 7:81f1c4fae022 | 223 | switch(i){ |
Palm2NOPY | 8:2bcc87bbd034 | 224 | case 0: |
Palm2NOPY | 8:2bcc87bbd034 | 225 | i = 5; |
Palm2NOPY | 8:2bcc87bbd034 | 226 | break; |
saiagard | 7:81f1c4fae022 | 227 | case 1: |
saiagard | 7:81f1c4fae022 | 228 | //myLCD.cls(); |
saiagard | 7:81f1c4fae022 | 229 | myLCD.fillrect(0,0,500,50,Orange); |
saiagard | 7:81f1c4fae022 | 230 | myLCD.rect(155,70,320,120,Orange); |
saiagard | 7:81f1c4fae022 | 231 | myLCD.rect(155,130,320,180,Orange); |
saiagard | 7:81f1c4fae022 | 232 | myLCD.rect(155,190,320,240,Orange); |
saiagard | 7:81f1c4fae022 | 233 | myLCD.rect(155,250,320,300,Orange); |
saiagard | 7:81f1c4fae022 | 234 | myLCD.set_font((unsigned char*) Arial28x28); |
saiagard | 7:81f1c4fae022 | 235 | myLCD.locate(160,15); |
saiagard | 7:81f1c4fae022 | 236 | myLCD.background(Orange); |
saiagard | 7:81f1c4fae022 | 237 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 238 | myLCD.printf("Select Mode"); |
saiagard | 7:81f1c4fae022 | 239 | myLCD.set_font((unsigned char*) Arial24x23); |
saiagard | 7:81f1c4fae022 | 240 | myLCD.locate(162,85); |
saiagard | 7:81f1c4fae022 | 241 | myLCD.background(Yellow); |
saiagard | 7:81f1c4fae022 | 242 | myLCD.foreground(Green); |
saiagard | 7:81f1c4fae022 | 243 | myLCD.printf(" Document"); |
saiagard | 7:81f1c4fae022 | 244 | myLCD.locate(187,145); |
saiagard | 7:81f1c4fae022 | 245 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 246 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 247 | myLCD.printf("ID Card"); |
saiagard | 7:81f1c4fae022 | 248 | myLCD.locate(177,205); |
saiagard | 7:81f1c4fae022 | 249 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 250 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 251 | myLCD.printf("Financial"); |
saiagard | 7:81f1c4fae022 | 252 | myLCD.locate(202,265); |
saiagard | 7:81f1c4fae022 | 253 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 254 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 255 | myLCD.printf("Other"); |
saiagard | 7:81f1c4fae022 | 256 | wait(0.3); |
saiagard | 7:81f1c4fae022 | 257 | break; |
saiagard | 7:81f1c4fae022 | 258 | case 2: |
saiagard | 7:81f1c4fae022 | 259 | myLCD.fillrect(0,0,500,50,Orange); |
saiagard | 7:81f1c4fae022 | 260 | myLCD.rect(155,70,320,120,Orange); |
saiagard | 7:81f1c4fae022 | 261 | myLCD.rect(155,130,320,180,Orange); |
saiagard | 7:81f1c4fae022 | 262 | myLCD.rect(155,190,320,240,Orange); |
saiagard | 7:81f1c4fae022 | 263 | myLCD.rect(155,250,320,300,Orange); |
saiagard | 7:81f1c4fae022 | 264 | myLCD.set_font((unsigned char*) Arial28x28); |
saiagard | 7:81f1c4fae022 | 265 | myLCD.locate(160,15); |
saiagard | 7:81f1c4fae022 | 266 | myLCD.background(Orange); |
saiagard | 7:81f1c4fae022 | 267 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 268 | myLCD.printf("Select Mode"); |
saiagard | 7:81f1c4fae022 | 269 | myLCD.set_font((unsigned char*) Arial24x23); |
saiagard | 7:81f1c4fae022 | 270 | myLCD.locate(162,85); |
saiagard | 7:81f1c4fae022 | 271 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 272 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 273 | myLCD.printf(" Document"); |
saiagard | 7:81f1c4fae022 | 274 | myLCD.locate(187,145); |
saiagard | 7:81f1c4fae022 | 275 | myLCD.background(Yellow); |
saiagard | 7:81f1c4fae022 | 276 | myLCD.foreground(Green); |
saiagard | 7:81f1c4fae022 | 277 | myLCD.printf("ID Card"); |
saiagard | 7:81f1c4fae022 | 278 | myLCD.locate(177,205); |
saiagard | 7:81f1c4fae022 | 279 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 280 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 281 | myLCD.printf("Financial"); |
saiagard | 7:81f1c4fae022 | 282 | myLCD.locate(202,265); |
saiagard | 7:81f1c4fae022 | 283 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 284 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 285 | myLCD.printf("Other"); |
saiagard | 7:81f1c4fae022 | 286 | wait(0.3); |
saiagard | 7:81f1c4fae022 | 287 | break; |
saiagard | 7:81f1c4fae022 | 288 | case 3: |
saiagard | 7:81f1c4fae022 | 289 | myLCD.fillrect(0,0,500,50,Orange); |
saiagard | 7:81f1c4fae022 | 290 | myLCD.rect(155,70,320,120,Orange); |
saiagard | 7:81f1c4fae022 | 291 | myLCD.rect(155,130,320,180,Orange); |
saiagard | 7:81f1c4fae022 | 292 | myLCD.rect(155,190,320,240,Orange); |
saiagard | 7:81f1c4fae022 | 293 | myLCD.rect(155,250,320,300,Orange); |
saiagard | 7:81f1c4fae022 | 294 | myLCD.set_font((unsigned char*) Arial28x28); |
saiagard | 7:81f1c4fae022 | 295 | myLCD.locate(160,15); |
saiagard | 7:81f1c4fae022 | 296 | myLCD.background(Orange); |
saiagard | 7:81f1c4fae022 | 297 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 298 | myLCD.printf("Select Mode"); |
saiagard | 7:81f1c4fae022 | 299 | myLCD.set_font((unsigned char*) Arial24x23); |
saiagard | 7:81f1c4fae022 | 300 | myLCD.locate(162,85); |
saiagard | 7:81f1c4fae022 | 301 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 302 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 303 | myLCD.printf(" Document"); |
saiagard | 7:81f1c4fae022 | 304 | myLCD.locate(187,145); |
saiagard | 7:81f1c4fae022 | 305 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 306 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 307 | myLCD.printf("ID Card"); |
saiagard | 7:81f1c4fae022 | 308 | myLCD.locate(177,205); |
saiagard | 7:81f1c4fae022 | 309 | myLCD.background(Yellow); |
saiagard | 7:81f1c4fae022 | 310 | myLCD.foreground(Green); |
saiagard | 7:81f1c4fae022 | 311 | myLCD.printf("Financial"); |
saiagard | 7:81f1c4fae022 | 312 | myLCD.locate(202,265); |
saiagard | 7:81f1c4fae022 | 313 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 314 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 315 | myLCD.printf("Other"); |
saiagard | 7:81f1c4fae022 | 316 | wait(0.3); |
saiagard | 7:81f1c4fae022 | 317 | break; |
saiagard | 7:81f1c4fae022 | 318 | case 4: |
saiagard | 7:81f1c4fae022 | 319 | myLCD.fillrect(0,0,500,50,Orange); |
saiagard | 7:81f1c4fae022 | 320 | myLCD.rect(155,70,320,120,Orange); |
saiagard | 7:81f1c4fae022 | 321 | myLCD.rect(155,130,320,180,Orange); |
saiagard | 7:81f1c4fae022 | 322 | myLCD.rect(155,190,320,240,Orange); |
saiagard | 7:81f1c4fae022 | 323 | myLCD.rect(155,250,320,300,Orange); |
saiagard | 7:81f1c4fae022 | 324 | myLCD.set_font((unsigned char*) Arial28x28); |
saiagard | 7:81f1c4fae022 | 325 | myLCD.locate(160,15); |
saiagard | 7:81f1c4fae022 | 326 | myLCD.background(Orange); |
saiagard | 7:81f1c4fae022 | 327 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 328 | myLCD.printf("Select Mode"); |
saiagard | 7:81f1c4fae022 | 329 | myLCD.set_font((unsigned char*) Arial24x23); |
saiagard | 7:81f1c4fae022 | 330 | myLCD.locate(162,85); |
saiagard | 7:81f1c4fae022 | 331 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 332 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 333 | myLCD.printf(" Document"); |
saiagard | 7:81f1c4fae022 | 334 | myLCD.locate(187,145); |
saiagard | 7:81f1c4fae022 | 335 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 336 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 337 | myLCD.printf("ID Card"); |
saiagard | 7:81f1c4fae022 | 338 | myLCD.locate(177,205); |
saiagard | 7:81f1c4fae022 | 339 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 340 | myLCD.foreground(Black); |
saiagard | 7:81f1c4fae022 | 341 | myLCD.printf("Financial"); |
saiagard | 7:81f1c4fae022 | 342 | myLCD.locate(202,265); |
saiagard | 7:81f1c4fae022 | 343 | myLCD.background(Yellow); |
saiagard | 7:81f1c4fae022 | 344 | myLCD.foreground(Green); |
saiagard | 7:81f1c4fae022 | 345 | myLCD.printf("Other"); |
saiagard | 7:81f1c4fae022 | 346 | wait(0.3); |
saiagard | 7:81f1c4fae022 | 347 | break; |
saiagard | 7:81f1c4fae022 | 348 | } |
saiagard | 7:81f1c4fae022 | 349 | } |
saiagard | 7:81f1c4fae022 | 350 | else if(Sw[4] == 0){ |
saiagard | 7:81f1c4fae022 | 351 | Pagejawjiw++; |
saiagard | 7:81f1c4fae022 | 352 | wait(0.3); |
cakejohnn | 11:7f4df462b2a5 | 353 | if(typeA == 1){ |
cakejohnn | 11:7f4df462b2a5 | 354 | char a[] = "1"; |
cakejohnn | 11:7f4df462b2a5 | 355 | esp.putc(a[0]); |
cakejohnn | 11:7f4df462b2a5 | 356 | } |
cakejohnn | 11:7f4df462b2a5 | 357 | if(typeB == 2){ |
cakejohnn | 11:7f4df462b2a5 | 358 | char b[] = "2"; |
cakejohnn | 11:7f4df462b2a5 | 359 | esp.putc(b[0]); |
cakejohnn | 11:7f4df462b2a5 | 360 | } |
cakejohnn | 11:7f4df462b2a5 | 361 | if(typeC == 3){ |
cakejohnn | 11:7f4df462b2a5 | 362 | char c[] = "3"; |
cakejohnn | 11:7f4df462b2a5 | 363 | esp.putc(c[0]); |
cakejohnn | 11:7f4df462b2a5 | 364 | } |
cakejohnn | 11:7f4df462b2a5 | 365 | if(typeD == 4){ |
cakejohnn | 11:7f4df462b2a5 | 366 | char d[] = "4"; |
cakejohnn | 11:7f4df462b2a5 | 367 | esp.putc(d[0]); |
cakejohnn | 11:7f4df462b2a5 | 368 | } |
cakejohnn | 11:7f4df462b2a5 | 369 | |
cakejohnn | 11:7f4df462b2a5 | 370 | |
cakejohnn | 11:7f4df462b2a5 | 371 | |
cakejohnn | 11:7f4df462b2a5 | 372 | |
cakejohnn | 11:7f4df462b2a5 | 373 | |
saiagard | 7:81f1c4fae022 | 374 | } |
saiagard | 7:81f1c4fae022 | 375 | } |
saiagard | 7:81f1c4fae022 | 376 | else if(Pagejawjiw == 2){ |
saiagard | 7:81f1c4fae022 | 377 | if(j == 0 or Sw[1] == 0){ |
saiagard | 7:81f1c4fae022 | 378 | switch(j){ |
saiagard | 7:81f1c4fae022 | 379 | case 0: |
saiagard | 7:81f1c4fae022 | 380 | j++; |
saiagard | 7:81f1c4fae022 | 381 | myLCD.cls(); |
saiagard | 7:81f1c4fae022 | 382 | myLCD.fillrect(0,0,500,50,Orange); |
saiagard | 7:81f1c4fae022 | 383 | myLCD.locate(150,15); |
saiagard | 7:81f1c4fae022 | 384 | myLCD.background(Orange); |
saiagard | 7:81f1c4fae022 | 385 | myLCD.set_font((unsigned char*) Arial28x28); |
saiagard | 7:81f1c4fae022 | 386 | myLCD.printf("Select JorJew"); |
saiagard | 7:81f1c4fae022 | 387 | myLCD.fillrect(40,130,215,230,DarkGrey); |
saiagard | 7:81f1c4fae022 | 388 | myLCD.fillrect(265,130,440,230,DarkGrey); |
saiagard | 7:81f1c4fae022 | 389 | myLCD.fillcircle(127,182,40,Yellow); |
saiagard | 7:81f1c4fae022 | 390 | myLCD.fillcircle(347,182,40,White); |
saiagard | 7:81f1c4fae022 | 391 | myLCD.set_font((unsigned char*) Arial43x48_numb, 46, 58, false); |
saiagard | 7:81f1c4fae022 | 392 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 393 | myLCD.locate(106,160); |
saiagard | 7:81f1c4fae022 | 394 | myLCD.printf(" 1"); |
saiagard | 7:81f1c4fae022 | 395 | myLCD.locate(326,160); |
saiagard | 7:81f1c4fae022 | 396 | myLCD.printf(" 2"); |
saiagard | 7:81f1c4fae022 | 397 | wait(0.3); |
saiagard | 7:81f1c4fae022 | 398 | break; |
saiagard | 7:81f1c4fae022 | 399 | case 1: |
saiagard | 7:81f1c4fae022 | 400 | myLCD.fillrect(0,0,500,50,Orange); |
saiagard | 7:81f1c4fae022 | 401 | myLCD.locate(150,15); |
saiagard | 7:81f1c4fae022 | 402 | myLCD.background(Orange); |
saiagard | 7:81f1c4fae022 | 403 | myLCD.set_font((unsigned char*) Arial28x28); |
saiagard | 7:81f1c4fae022 | 404 | myLCD.printf("Select JorJew"); |
saiagard | 7:81f1c4fae022 | 405 | myLCD.fillrect(40,130,215,230,DarkGrey); |
saiagard | 7:81f1c4fae022 | 406 | myLCD.fillrect(265,130,440,230,DarkGrey); |
Palm2NOPY | 8:2bcc87bbd034 | 407 | myLCD.fillcircle(127,182,40,White); |
Palm2NOPY | 8:2bcc87bbd034 | 408 | myLCD.fillcircle(347,182,40,Yellow); |
saiagard | 7:81f1c4fae022 | 409 | myLCD.set_font((unsigned char*) Arial43x48_numb, 46, 58, false); |
saiagard | 7:81f1c4fae022 | 410 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 411 | myLCD.locate(106,160); |
saiagard | 7:81f1c4fae022 | 412 | myLCD.printf(" 1"); |
saiagard | 7:81f1c4fae022 | 413 | myLCD.locate(326,160); |
saiagard | 7:81f1c4fae022 | 414 | myLCD.printf(" 2"); |
saiagard | 7:81f1c4fae022 | 415 | wait(0.3); |
saiagard | 7:81f1c4fae022 | 416 | break; |
saiagard | 7:81f1c4fae022 | 417 | } |
saiagard | 7:81f1c4fae022 | 418 | } |
saiagard | 7:81f1c4fae022 | 419 | else if(Sw[3] == 0){ |
saiagard | 7:81f1c4fae022 | 420 | myLCD.fillrect(0,0,500,50,Orange); |
saiagard | 7:81f1c4fae022 | 421 | myLCD.locate(150,15); |
saiagard | 7:81f1c4fae022 | 422 | myLCD.background(Orange); |
saiagard | 7:81f1c4fae022 | 423 | myLCD.set_font((unsigned char*) Arial28x28); |
saiagard | 7:81f1c4fae022 | 424 | myLCD.printf("Select JorJew"); |
saiagard | 7:81f1c4fae022 | 425 | myLCD.fillrect(40,130,215,230,DarkGrey); |
saiagard | 7:81f1c4fae022 | 426 | myLCD.fillrect(265,130,440,230,DarkGrey); |
Palm2NOPY | 8:2bcc87bbd034 | 427 | myLCD.fillcircle(127,182,40,Yellow); |
Palm2NOPY | 8:2bcc87bbd034 | 428 | myLCD.fillcircle(347,182,40,White); |
saiagard | 7:81f1c4fae022 | 429 | myLCD.set_font((unsigned char*) Arial43x48_numb, 46, 58, false); |
saiagard | 7:81f1c4fae022 | 430 | myLCD.background(White); |
saiagard | 7:81f1c4fae022 | 431 | myLCD.locate(106,160); |
saiagard | 7:81f1c4fae022 | 432 | myLCD.printf(" 1"); |
saiagard | 7:81f1c4fae022 | 433 | myLCD.locate(326,160); |
saiagard | 7:81f1c4fae022 | 434 | myLCD.printf(" 2"); |
saiagard | 7:81f1c4fae022 | 435 | wait(0.3); |
saiagard | 7:81f1c4fae022 | 436 | } |
saiagard | 7:81f1c4fae022 | 437 | else if(Sw[5] == 0){ |
saiagard | 7:81f1c4fae022 | 438 | Pagejawjiw = 1; |
Palm2NOPY | 8:2bcc87bbd034 | 439 | wait(0.3); |
saiagard | 7:81f1c4fae022 | 440 | i = 0; |
Palm2NOPY | 8:2bcc87bbd034 | 441 | myLCD.cls(); |
Palm2NOPY | 8:2bcc87bbd034 | 442 | } |
Palm2NOPY | 8:2bcc87bbd034 | 443 | else if(Sw[4] == 0){ |
Palm2NOPY | 8:2bcc87bbd034 | 444 | Pagejawjiw++; |
Palm2NOPY | 8:2bcc87bbd034 | 445 | wait(0.3); |
Palm2NOPY | 8:2bcc87bbd034 | 446 | myLCD.cls(); |
Palm2NOPY | 8:2bcc87bbd034 | 447 | k=0; |
saiagard | 7:81f1c4fae022 | 448 | } |
saiagard | 7:81f1c4fae022 | 449 | } |
Palm2NOPY | 8:2bcc87bbd034 | 450 | else if(Pagejawjiw == 3){ |
Palm2NOPY | 8:2bcc87bbd034 | 451 | if(k==0 or Sw[1] == 0){ |
Palm2NOPY | 8:2bcc87bbd034 | 452 | myLCD.fillrect(0,0,500,50,Orange); |
Palm2NOPY | 8:2bcc87bbd034 | 453 | myLCD.locate(150,15); |
Palm2NOPY | 8:2bcc87bbd034 | 454 | myLCD.background(Orange); |
khimAS | 10:2985dc4e40a5 | 455 | myLCD.fillrect(125,90,355,230,Green); |
Palm2NOPY | 8:2bcc87bbd034 | 456 | myLCD.set_font((unsigned char*) Arial28x28); |
Palm2NOPY | 8:2bcc87bbd034 | 457 | myLCD.locate(165,130); |
Palm2NOPY | 8:2bcc87bbd034 | 458 | myLCD.background(Green); |
Palm2NOPY | 8:2bcc87bbd034 | 459 | myLCD.foreground(Black); |
khimAS | 10:2985dc4e40a5 | 460 | myLCD.printf(" Take out"); |
Palm2NOPY | 8:2bcc87bbd034 | 461 | myLCD.locate(155,170); |
Palm2NOPY | 8:2bcc87bbd034 | 462 | myLCD.printf(" JorJew#1/2"); |
Palm2NOPY | 8:2bcc87bbd034 | 463 | myLCD.fillrect(100,250,215,300,Yellow); |
Palm2NOPY | 8:2bcc87bbd034 | 464 | myLCD.fillrect(265,250,380,300,Yellow); |
Palm2NOPY | 8:2bcc87bbd034 | 465 | myLCD.locate(110,260); |
Palm2NOPY | 8:2bcc87bbd034 | 466 | myLCD.background(Green); |
Palm2NOPY | 8:2bcc87bbd034 | 467 | myLCD.foreground(Black); |
Palm2NOPY | 8:2bcc87bbd034 | 468 | myLCD.printf("(A)"); |
Palm2NOPY | 8:2bcc87bbd034 | 469 | myLCD.locate(265,260); |
Palm2NOPY | 8:2bcc87bbd034 | 470 | myLCD.printf("(C)"); |
Palm2NOPY | 8:2bcc87bbd034 | 471 | k++; |
Palm2NOPY | 8:2bcc87bbd034 | 472 | wait(0.3); |
Palm2NOPY | 8:2bcc87bbd034 | 473 | } |
Palm2NOPY | 8:2bcc87bbd034 | 474 | else if((Sw[0] == 0)){ |
Palm2NOPY | 8:2bcc87bbd034 | 475 | myLCD.cls(); |
Palm2NOPY | 8:2bcc87bbd034 | 476 | Pagejawjiw++; |
Palm2NOPY | 8:2bcc87bbd034 | 477 | wait(0.3); |
Palm2NOPY | 8:2bcc87bbd034 | 478 | } |
Palm2NOPY | 8:2bcc87bbd034 | 479 | else if((Sw[2] == 0)){ |
Palm2NOPY | 8:2bcc87bbd034 | 480 | Pagejawjiw--; |
Palm2NOPY | 8:2bcc87bbd034 | 481 | wait(0.3); |
Palm2NOPY | 8:2bcc87bbd034 | 482 | j = 0; |
Palm2NOPY | 8:2bcc87bbd034 | 483 | } |
Palm2NOPY | 8:2bcc87bbd034 | 484 | } |
Palm2NOPY | 8:2bcc87bbd034 | 485 | else if(Pagejawjiw == 4){ |
Palm2NOPY | 8:2bcc87bbd034 | 486 | myLCD.cls(); |
Palm2NOPY | 8:2bcc87bbd034 | 487 | myLCD.background(backgroundcolor); |
Palm2NOPY | 8:2bcc87bbd034 | 488 | myLCD.foreground(foregroundcolor); |
Palm2NOPY | 8:2bcc87bbd034 | 489 | myLCD.Bitmap(150,45,180,180,data); |
Palm2NOPY | 8:2bcc87bbd034 | 490 | myLCD.fillrect(0,320,500,280,Orange); |
Palm2NOPY | 8:2bcc87bbd034 | 491 | time=t.read_us(); |
khimAS | 9:914f2ea246bc | 492 | Pagejawjiw = 0; |
Palm2NOPY | 8:2bcc87bbd034 | 493 | i = 0; |
Palm2NOPY | 8:2bcc87bbd034 | 494 | for(int i=2; i<350;i++){ |
Palm2NOPY | 8:2bcc87bbd034 | 495 | myLCD.locate(i,295); |
Palm2NOPY | 8:2bcc87bbd034 | 496 | myLCD.set_font((unsigned char*) Arial12x12); |
Palm2NOPY | 8:2bcc87bbd034 | 497 | myLCD.printf("Love , Thank you"); |
Palm2NOPY | 8:2bcc87bbd034 | 498 | } |
Palm2NOPY | 8:2bcc87bbd034 | 499 | for(int i=350; i>=2;i--){ |
Palm2NOPY | 8:2bcc87bbd034 | 500 | myLCD.locate(i,295); |
Palm2NOPY | 8:2bcc87bbd034 | 501 | myLCD.set_font((unsigned char*) Arial12x12); |
Palm2NOPY | 8:2bcc87bbd034 | 502 | myLCD.printf("Love , Thank you"); |
Palm2NOPY | 8:2bcc87bbd034 | 503 | } |
Palm2NOPY | 8:2bcc87bbd034 | 504 | wait(5); |
Palm2NOPY | 8:2bcc87bbd034 | 505 | myLCD.cls(); |
Palm2NOPY | 8:2bcc87bbd034 | 506 | } |
khimAS | 10:2985dc4e40a5 | 507 | } |
Geremia | 0:2ccd65a72ab8 | 508 | } |