hjkj
Dependencies: TFT-RFID_Finish mbed MFRC522 UniGraphic
Diff: main.cpp
- Revision:
- 8:2bcc87bbd034
- Parent:
- 7:81f1c4fae022
- Child:
- 9:914f2ea246bc
--- a/main.cpp Fri Dec 14 05:54:31 2018 +0000 +++ b/main.cpp Fri Dec 14 11:55:49 2018 +0000 @@ -20,6 +20,7 @@ char orient=1; int i=0; int j=0; +int k=0; int Pagejawjiw = 1; int state = 0; int main() @@ -91,7 +92,7 @@ i++; switch(i){ case 1: - myLCD.cls(); + //myLCD.cls(); myLCD.fillrect(0,0,500,50,Orange); myLCD.rect(155,70,320,120,Orange); myLCD.rect(155,130,320,180,Orange); @@ -213,12 +214,18 @@ myLCD.foreground(Green); myLCD.printf("Other"); wait(0.3); + break; + case 5: + i=0; break; } } else if(Sw[0] == 0){ i--; switch(i){ + case 0: + i = 5; + break; case 1: //myLCD.cls(); myLCD.fillrect(0,0,500,50,Orange); @@ -385,8 +392,8 @@ myLCD.printf("Select JorJew"); myLCD.fillrect(40,130,215,230,DarkGrey); myLCD.fillrect(265,130,440,230,DarkGrey); - myLCD.fillcircle(127,182,40,Yellow); - myLCD.fillcircle(347,182,40,White); + myLCD.fillcircle(127,182,40,White); + myLCD.fillcircle(347,182,40,Yellow); myLCD.set_font((unsigned char*) Arial43x48_numb, 46, 58, false); myLCD.background(White); myLCD.locate(106,160); @@ -405,8 +412,8 @@ myLCD.printf("Select JorJew"); myLCD.fillrect(40,130,215,230,DarkGrey); myLCD.fillrect(265,130,440,230,DarkGrey); - myLCD.fillcircle(127,182,40,White); - myLCD.fillcircle(347,182,40,Yellow); + myLCD.fillcircle(127,182,40,Yellow); + myLCD.fillcircle(347,182,40,White); myLCD.set_font((unsigned char*) Arial43x48_numb, 46, 58, false); myLCD.background(White); myLCD.locate(106,160); @@ -417,9 +424,115 @@ } else if(Sw[5] == 0){ Pagejawjiw = 1; + wait(0.3); i = 0; + myLCD.cls(); + } + else if(Sw[4] == 0){ + Pagejawjiw++; + wait(0.3); + myLCD.cls(); + //break; + k=0; } } + else if(Pagejawjiw == 3){ + if(k==0 or Sw[1] == 0){ + //myLCD.cls(); + myLCD.fillrect(0,0,500,50,Orange); + myLCD.locate(150,15); + myLCD.background(Orange); + //myLCD.set_font((unsigned char*) Arial28x28); +// myLCD.printf("Select JorJew"); +// myLCD.fillrect(40,130,215,230,DarkGrey); +// myLCD.fillrect(265,130,440,230,DarkGrey); +// myLCD.fillcircle(127,182,40,White); +// myLCD.fillcircle(347,182,40,White); +// myLCD.set_font((unsigned char*) Arial43x48_numb, 46, 58, false); +// myLCD.background(White); +// myLCD.locate(106,160); +// myLCD.printf(" 1"); +// myLCD.locate(326,160); +// myLCD.printf(" 2"); + myLCD.fillrect(125,90,355,230,Green); //pop-up + myLCD.set_font((unsigned char*) Arial28x28); + myLCD.locate(165,130); + myLCD.background(Green); + myLCD.foreground(Black); + myLCD.printf(" Take out"); //chosen jor + myLCD.locate(155,170); + myLCD.printf(" JorJew#1/2"); + myLCD.fillrect(100,250,215,300,Yellow); + myLCD.fillrect(265,250,380,300,Yellow); + myLCD.locate(110,260); + myLCD.background(Green); + myLCD.foreground(Black); + myLCD.printf("(A)"); + myLCD.locate(265,260); + myLCD.printf("(C)"); + k++; + //Pagejawjiw++; + wait(0.3); + //myLCD.cls(); + //break; + //pc.printf("%d",k); +// wait(0.3); + // switch(k){ +// case 0: +// if(Sw[0] == 0){ +// Pagejawjiw++; +// wait(0.3); +// //myLCD.cls(); +// break; +// } +// else if(Sw[2] == 0){ +// Pagejawjiw = 2; +// wait(0.3); +// //myLCD.cls(); +// break; +// } + } + else if((Sw[0] == 0)){ + myLCD.cls(); + Pagejawjiw++; + wait(0.3); + //break; + } + else if((Sw[2] == 0)){ + //myLCD.cls(); + Pagejawjiw--; + wait(0.3); + j = 0; + //break; + } + } + else if(Pagejawjiw == 4){ + myLCD.cls(); + myLCD.background(backgroundcolor); + myLCD.foreground(foregroundcolor); + myLCD.Bitmap(150,45,180,180,data); + myLCD.fillrect(0,320,500,280,Orange); + time=t.read_us(); + Pagejawjiw = 1; + i = 0; + for(int i=2; i<350;i++){ + myLCD.locate(i,295); + myLCD.set_font((unsigned char*) Arial12x12); + myLCD.printf("Love , Thank you"); + } + for(int i=350; i>=2;i--){ + myLCD.locate(i,295); + myLCD.set_font((unsigned char*) Arial12x12); + myLCD.printf("Love , Thank you"); + } + wait(5); + myLCD.cls(); +// while(Sw[5] == 0){ +// Pagejawjiw = 1; +// wait(0.3); +// } + } + //} //point//