mix
Dependencies: mbed Servo MFRC522 UniGraphic
Revision 14:4868cae27325, committed 2018-12-19
- Comitter:
- Palm2NOPY
- Date:
- Wed Dec 19 00:48:12 2018 +0000
- Parent:
- 13:4d66521f6d89
- Commit message:
- mix
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 4d66521f6d89 -r 4868cae27325 main.cpp --- a/main.cpp Tue Dec 18 23:43:20 2018 +0000 +++ b/main.cpp Wed Dec 19 00:48:12 2018 +0000 @@ -40,7 +40,7 @@ int state = 0; int select = 0; int main(){ - pc.baud(9600); + pc.baud(115200); esp.baud(9600); char *StudentID; uint8_t UIDCard[4]={}; @@ -58,6 +58,10 @@ char Num; char Jaw1[3]; char Jaw2[3]; + char Qa; + char Qb; + char Qc; + char Qd; if(Pagejawjiw == 0){ myLCD.background(backgroundcolor); myLCD.foreground(foregroundcolor); @@ -383,274 +387,362 @@ if(select == 1){ Type = '1'; queueA += 1; + Qa += 'A'; char a[] = "A"; esp.putc(a[0]); char ty1 = esp.putc(a[0]); pc.printf("type %c\n",ty1); if(queueA == 1){ char one[] = "1"; + Qa += "1"; esp.putc(one[0]); char one1 = esp.putc(a[0]); pc.printf("queue %c\n",one1); } else if(queueA == 2){ char two[] = "2"; + Qa += "2"; esp.putc(two[0]); } else if(queueA == 3){ char three[] = "3"; + Qa += "3"; esp.putc(three[0]); } else if(queueA == 4){ char four[] = "4"; + Qa += "4"; esp.putc(four[0]); } else if(queueA == 5){ char five[] = "5"; + Qa += "5"; esp.putc(five[0]); } else if(queueA == 6){ char six[] = "6"; + Qa += "6"; esp.putc(six[0]); } else if(queueA == 7){ char seven[] = "7"; + Qa += "7"; esp.putc(seven[0]); } else if(queueA == 8){ char eight[] = "8"; + Qa += "8"; esp.putc(eight[0]); } else if(queueA == 9){ char nine[] = "9"; + Qa += "9"; esp.putc(nine[0]); } else if(queueA == 10){ char ten[] = "E"; + Qa += "1"; + Qa += "0"; esp.putc(ten[0]); } else if(queueA == 11){ char eleven[] = "F"; + Qa += "1"; + Qa += "1"; esp.putc(eleven[0]); } else if(queueA == 12){ char twevle[] = "G"; + Qa += "1"; + Qa += "2"; esp.putc(twevle[0]); } else if(queueA == 13){ char thteen[] = "H"; + Qa += "1"; + Qa += "3"; esp.putc(thteen[0]); } else if(queueA == 14){ char fourteen[] = "I"; + Qa += "1"; + Qa += "4"; esp.putc(fourteen[0]); } else if(queueA == 15){ char fifthteen[] = "J"; + Qa += "1"; + Qa += "5"; esp.putc(fifthteen[0]); } } else if(select == 2){ Type = '2'; queueB += 1; + Qb += 'B'; char b[] = "B"; esp.putc(b[0]); char ty2 = esp.putc(b[0]); pc.printf("type %c\n",ty2); if(queueB == 1){ char one2[] = "1"; + Qb += "1"; esp.putc(one2[0]); } else if(queueB == 2){ char two2[] = "2"; + Qb += "2"; esp.putc(two2[0]); } else if(queueB == 3){ char three2[] = "3"; + Qb += "3"; esp.putc(three2[0]); } else if(queueB == 4){ char four2[] = "4"; + Qb += "4"; esp.putc(four2[0]); } else if(queueB == 5){ char five2[] = "5"; + Qb += "5"; esp.putc(five2[0]); } else if(queueB == 6){ char six2[] = "6"; + Qb += "6"; esp.putc(six2[0]); } else if(queueB == 7){ char seven2[] = "7"; + Qb += "7"; esp.putc(seven2[0]); } else if(queueB == 8){ char eight2[] = "8"; + Qb += "8"; esp.putc(eight2[0]); } else if(queueB == 9){ char nine2[] = "9"; + Qb += "9"; esp.putc(nine2[0]); } else if(queueB == 10){ char ten2[] = "E"; + Qb += "1"; + Qb += "0"; esp.putc(ten2[0]); } else if(queueB == 11){ char eleven2[] = "F"; + Qb += "1"; + Qb += "1"; esp.putc(eleven2[0]); } else if(queueB == 12){ char twevle2[] = "G"; + Qb += "1"; + Qb += "2"; esp.putc(twevle2[0]); } else if(queueB == 13){ char thteen2[] = "H"; + Qb += "1"; + Qb += "3"; esp.putc(thteen2[0]); } else if(queueB == 14){ char fourteen2[] = "I"; + Qb += "1"; + Qb += "4"; esp.putc(fourteen2[0]); } else if(queueB == 15){ char fifthteen2[] = "J"; + Qb += "1"; + Qb += "5"; esp.putc(fifthteen2[0]); } } else if(select == 3){ Type = '3'; queueC += 1; + Qc += 'C'; char c[] = "C"; esp.putc(c[0]); char ty3 = esp.putc(c[0]); pc.printf("type %c\n",ty3); if(queueC == 1){ char one3[] = "1"; + Qc += "1"; esp.putc(one3[0]); } else if(queueC == 2){ char two3[] = "2"; + Qc += "2"; esp.putc(two3[0]); } else if(queueC == 3){ char three3[] = "3"; + Qc += "3"; esp.putc(three3[0]); } else if(queueC == 4){ char four3[] = "4"; + Qc += "4"; esp.putc(four3[0]); } else if(queueC == 5){ char five3[] = "5"; + Qc += "5"; esp.putc(five3[0]); } else if(queueC == 6){ char six3[] = "6"; + Qc += "6"; esp.putc(six3[0]); } else if(queueC == 7){ char seven3[] = "7"; + Qc += "7"; esp.putc(seven3[0]); } else if(queueC == 8){ char eight3[] = "8"; + Qc += "8"; esp.putc(eight3[0]); } else if(queueC == 9){ char nine3[] = "9"; + Qc += "9"; esp.putc(nine3[0]); } else if(queueC == 10){ char ten3[] = "E"; + Qc += "1"; + Qc += "0"; esp.putc(ten3[0]); } else if(queueC == 11){ char eleven3[] = "F"; + Qc += "1"; + Qc += "1"; esp.putc(eleven3[0]); } else if(queueC == 12){ char twevle3[] = "G"; + Qc += "1"; + Qc += "2"; esp.putc(twevle3[0]); } else if(queueC == 13){ char thteen3[] = "H"; + Qc += "1"; + Qc += "3"; esp.putc(thteen3[0]); } else if(queueC == 14){ char fourteen3[] = "I"; + Qc += "1"; + Qc += "4"; esp.putc(fourteen3[0]); } else if(queueC == 15){ char fifthteen3[] = "J"; + Qc += "1"; + Qc += "5"; esp.putc(fifthteen3[0]); } } else if(select == 4){ Type = '4'; queueD += 1; + Qd += 'D'; char d[] = "D"; esp.putc(d[0]); char ty4 = esp.putc(d[0]); pc.printf("type %c\n",ty4); if(queueD == 1){ char one4[] = "1"; + Qd += "1"; esp.putc(one4[0]); } else if(queueD == 2){ char two4[] = "2"; + Qd += "2"; esp.putc(two4[0]); } else if(queueD == 3){ char three4[] = "3"; + Qd += "3"; esp.putc(three4[0]); } else if(queueD == 4){ char four4[] = "4"; + Qd += "4"; esp.putc(four4[0]); } else if(queueD == 5){ char five4[] = "5"; + Qd += "5"; esp.putc(five4[0]); } else if(queueD == 6){ char six4[] = "6"; + Qd += "6"; esp.putc(six4[0]); } else if(queueD == 7){ char seven4[] = "7"; + Qd += "7"; esp.putc(seven4[0]); } else if(queueD == 8){ char eight4[] = "8"; + Qd += "8"; esp.putc(eight4[0]); } else if(queueD == 9){ char nine4[] = "9"; + Qd += "9"; esp.putc(nine4[0]); } else if(queueD == 10){ char ten4[] = "E"; + Qd += "1"; + Qd += "0"; esp.putc(ten4[0]); } else if(queueD == 11){ char eleven4[] = "F"; + Qd += "1"; + Qd += "1"; esp.putc(eleven4[0]); } else if(queueD == 12){ char twevle4[] = "G"; + Qd += "1"; + Qd += "2"; esp.putc(twevle4[0]); } else if(queueD == 13){ char thteen4[] = "H"; + Qd += "1"; + Qd += "3"; esp.putc(thteen4[0]); } else if(queueD == 14){ char fourteen4[] = "I"; + Qd += "1"; + Qd += "4"; esp.putc(fourteen4[0]); } else if(queueD == 15){ char fifthteen4[] = "J"; + Qd += "1"; + Qd += "5"; esp.putc(fifthteen4[0]); } } @@ -734,8 +826,18 @@ } else if(Sw[4] == 0){ Pagejawjiw++; - if(j==1){Jaw1[0]=Type;Jaw1[1]=StD;Jaw1[2]=Num;pc.printf("%s",Jaw1);} - else if(j==2){Jaw2[0]=Type;Jaw2[1]=StD;Jaw2[2]=Num;pc.printf("%s",Jaw2);} + if(j==1){ + if(select == 1){ + hm10.putc(Qa[0]);hm10.putc(Qa[1]);hm10.putc(Qa[2]);Jaw1[0]=Type;Jaw1[1]=StD;Jaw1[2]=Num;pc.printf("%s",Jaw1);} + else if(select == 2){hm10.putc(Qb[0]);hm10.putc(Qb[1]);hm10.putc(Qb[2]);Jaw1[0]=Type;Jaw1[1]=StD;Jaw1[2]=Num;pc.printf("%s",Jaw1);} + else if(select == 3){hm10.putc(Qc[0]);hm10.putc(Qc[1]);hm10.putc(Qc[2]);Jaw1[0]=Type;Jaw1[1]=StD;Jaw1[2]=Num;pc.printf("%s",Jaw1);} + else if(select == 4){hm10.putc(Qd[0]);hm10.putc(Qd[1]);hm10.putc(Qd[2]);Jaw1[0]=Type;Jaw1[1]=StD;Jaw1[2]=Num;pc.printf("%s",Jaw1);}} + else if(j==2){ + if(select == 1){ + hm11.putc(Qa[0]);hm11.putc(Qa[1]);hm11.putc(Qa[2]);Jaw2[0]=Type;Jaw2[1]=StD;Jaw2[2]=Num;pc.printf("%s",Jaw2);} + else if(select == 2){hm11.putc(Qb[0]);hm11.putc(Qb[1]);hm11.putc(Qb[2]);Jaw2[0]=Type;Jaw2[1]=StD;Jaw2[2]=Num;pc.printf("%s",Jaw2);} + else if(select == 3){hm11.putc(Qc[0]);hm11.putc(Qc[1]);hm11.putc(Qc[2]);Jaw2[0]=Type;Jaw2[1]=StD;Jaw2[2]=Num;pc.printf("%s",Jaw2);} + else if(select == 4){hm11.putc(Qd[0]);hm11.putc(Qd[1]);hm11.putc(Qd[2]);Jaw2[0]=Type;Jaw2[1]=StD;Jaw2[2]=Num;pc.printf("%s",Jaw2);}} wait(0.3); myLCD.cls(); k=0;