LAMPIRAN Program C mikrokontrol untuk aplikasi connect /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////Multi Purpose Security System with Changeable Locker/////////////////////// ////////////////////////////Password Based Android Cellular Phone//////////////////////////////// /////////CONNECT DATA COMMUNICATION TESTER PROGRAM////////////////// /////////////////////////By : Avolga Arven Yuriancaesa 11.50.0001//////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// unsigned char GETADC,X; int SERIAL,SERIAL3; unsigned char SERIAL2[2]; unsigned char ADCVAL[8]; sbit LCD_RS at RD4_bit; sbit LCD_EN at RD5_bit; sbit LCD_D7 at RD3_bit; sbit LCD_D6 at RD2_bit; sbit LCD_D5 at RD1_bit; sbit LCD_D4 at RD0_bit; sbit LCD_RS_Direction at TRISD4_bit; sbit LCD_EN_Direction at TRISD5_bit; sbit LCD_D7_Direction at TRISD3_bit; sbit LCD_D6_Direction at TRISD2_bit; sbit LCD_D5_Direction at TRISD1_bit; sbit LCD_D4_Direction at TRISD0_bit; void ALPHABET() { SERIAL3=ATOI(SERIAL2); switch (SERIAL3) { case(0):UART1_WRITE_TEXT(" NOL");SERIAL=X; break; case(1):UART1_WRITE_TEXT(" SATU");SERIAL=X; break; case(2):UART1_WRITE_TEXT(" DUA");SERIAL=X; break; case(3):UART1_WRITE_TEXT(" TIGA");SERIAL=X; break; case(4):UART1_WRITE_TEXT(" EMPAT");SERIAL=X; break; case(5):UART1_WRITE_TEXT(" LIMA");SERIAL=X; break; case(6):UART1_WRITE_TEXT(" ENAM");SERIAL=X; break; case(7):UART1_WRITE_TEXT(" TUJUH");SERIAL=X; break; case(8):UART1_WRITE_TEXT(" DELAPAN");SERIAL=X; break; case(9):UART1_WRITE_TEXT(" SEMBILAN");SERIAL=X; break; } }
162
void INIT() { UART1_INIT(9600); ADC_INIT(); LCD_INIT(); LCD_OUT(1,1," C O N N E C T "); LCD_OUT(2,1," Avo 11.50.0001 "); DELAY_MS(2000); LCD_CMD(_LCD_CURSOR_OFF); LCD_CMD(_LCD_CLEAR); TRISB=0x00; PORTB=0x00; GETADC=0; } void main() { INIT(); while(1) { if (UART1_DATA_READY()==1) { LCD_CMD(_LCD_CLEAR); LCD_OUT(1,1,"DETECT : "); SERIAL=UART1_READ(); SERIAL2[0]=SERIAL; LCD_CHR(1,12,SERIAL); LCD_OUT(2,1,"F BACK : "); LCD_CHR(2,12,SERIAL); DELAY_MS(1000); ALPHABET(); DELAY_MS(2000); LCD_CMD(_LCD_CLEAR); } if (UART1_DATA_READY()==0) { LCD_OUT(1,1,"SEND : "); GETADC=ADC_READ(0); DELAY_MS(200); INTTOSTR(GETADC,ADCVAL); LCD_OUT(1,9,ADCVAL); UART1_WRITE_TEXT(ADCVAL); DELAY_MS(300); } } }
163
Program C mikrokontrol untuk aplikasi YUKI /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////Multi Purpose Security System with Changeable Locker////////////////// //////////////////////////Password Based Android Cellular Phone////////////////////////////////// //////////////////////////////////////////( YUKI. N > )//////////////////////////////////////////////////////// /////////////////////////By : Avolga Arven Yuriancaesa 11.50.0001//////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// char X,Y,A; int CODEA,CODEB,CODEC,CODED,CODEE,CODEF,CODEH,AB,CD,EF,GH,IJ, KL; int RXA,RXB,RXC,RXD,RXE,RXF,RXAA,RXBB,RXCC,RXDD,RXEE,RXFF; int ABXX,CDXX,EFXX,GHXX,IJXX,KLXX; char RXXA[2]; char RXXB[2]; char RXXC[2]; char RXXD[2]; char RXXE[2]; char RXXF[2]; char ABX[2]; char CDX[2]; char EFX[2]; char GHX[2]; char IJX[2]; char KLX[2]; sbit LCD_RS at RD4_bit; sbit LCD_EN at RD5_bit; sbit LCD_D7 at RD3_bit; sbit LCD_D6 at RD2_bit; sbit LCD_D5 at RD1_bit; sbit LCD_D4 at RD0_bit; sbit LCD_RS_Direction at TRISD4_bit; sbit LCD_EN_Direction at TRISD5_bit; sbit LCD_D7_Direction at TRISD3_bit; sbit LCD_D6_Direction at TRISD2_bit; sbit LCD_D5_Direction at TRISD1_bit; sbit LCD_D4_Direction at TRISD0_bit; void LOCK() { RB1_BIT=0; UART1_WRITE_TEXT("_LOCK"); DELAY_MS(2000); for(X=0;X<=100;X++)
164
{ RB0_BIT=1; DELAY_US(2000); RB0_BIT=0; DELAY_US(5000); } LCD_CMD(_LCD_CLEAR); } void UNLOCK() { RB1_BIT=1; UART1_WRITE_TEXT("_UNLOCK"); DELAY_MS(2000); for(X=0;X<=100;X++) { RB0_BIT=1; DELAY_US(1000); RB0_BIT=0; DELAY_US(5000); } LCD_CMD(_LCD_CLEAR); } void FALSE() { LCD_CMD(_LCD_CLEAR); LCD_OUT(1,1," INCORRECT CODE "); DELAY_MS(1000); CODEA=0; CODEB=0; CODEC=0; CODED=0; CODEE=0; CODEF=0; RXA=0; RXB=0; RXC=0; RXD=0; RXE=0; RXF=0; LOCK(); } void TRUE() { LCD_CMD(_LCD_CLEAR);
165
LCD_OUT(1,1," CORRECT CODE "); DELAY_MS(1000); CODEA=0; CODEB=0; CODEC=0; CODED=0; CODEE=0; CODEF=0; RXA=0; RXB=0; RXC=0; RXD=0; RXE=0; RXF=0; UNLOCK(); } void RESULT() { RXXA[0]= RXA; RXXB[0]= RXB; RXXC[0]= RXC; RXXD[0]= RXD; RXXE[0]= RXE; RXXF[0]= RXF; ABXX=ATOI(ABX); CDXX=ATOI(CDX); EFXX=ATOI(EFX); GHXX=ATOI(GHX); IJXX=ATOI(IJX); KLXX=ATOI(KLX); RXAA=ATOI(RXXA); RXBB=ATOI(RXXB); RXCC=ATOI(RXXC); RXDD=ATOI(RXXD); RXEE=ATOI(RXXE); RXFF=ATOI(RXXF); CODEA=RXAA; CODEB=RXBB; CODEC=RXCC; CODED=RXDD; CODEE=RXEE; CODEF=RXFF; DELAY_MS(100); if((CODEA==ABXX)&&(CODEB==CDXX)&&(CODEC==EFXX)&&(CODE D==GHXX)&&(CODEE==IJXX)&&(CODEF==KLXX))
166
{ TRUE(); } else FALSE(); } void INIT() { UART1_INIT(9600); LCD_INIT(); LCD_OUT(1,1," Y U K I . N > "); LCD_OUT(2,1," Avo 11.50.0001 "); DELAY_MS(2000); LCD_CMD(_LCD_CURSOR_OFF); LCD_CMD(_LCD_CLEAR); TRISB=0x00; PORTB=0x00; AB =A; CD =A; EF =A; GH =A; IJ =A; KL =A; } void main() { INIT(); while(1) { while((AB!=A)&&(CD!=A)&&(EF!=A)&&(GH!=A)&&(IJ!=A)&&(KL!=A)) { LCD_OUT(1,1,"INPUT: "); LCD_OUT(2,1,"CODE : "); if (UART1_DATA_READY()==1) { Y++; if (Y==1) { RXA=UART1_READ(); LCD_CHR(1,8,RXA); LCD_CHR(2,8,RXA); DELAY_MS(1); } if (Y==2)
167
{ RXB=UART1_READ(); LCD_CHR(1,8,RXB); LCD_CHR(2,9,RXB); DELAY_MS(1); } if (Y==3) { RXC=UART1_READ(); LCD_CHR(1,8,RXC); LCD_CHR(2,10,RXC); DELAY_MS(1); } if (Y==4) { RXD=UART1_READ(); LCD_CHR(1,8,RXD); LCD_CHR(2,11,RXD); DELAY_MS(1); } if (Y==5) { RXE=UART1_READ(); LCD_CHR(1,8,RXE); LCD_CHR(2,12,RXE); DELAY_MS(1); } if (Y>=6) { RXF=UART1_READ(); Y=0; LCD_CHR(1,8,RXF); LCD_CHR(2,13,RXF); Delay_ms(1000); LCD_CMD(_LCD_CLEAR); RESULT(); } } } LCD_OUT(1,1,"INPUT: "); LCD_OUT(2,1,"SET : "); if (UART1_DATA_READY()==1) { Y++; if (Y==1) {
168
AB=UART1_READ(); ABX[0]=AB; ABXX=ATOI(ABX); LCD_CHR(1,8,AB); LCD_CHR(2,8,AB); DELAY_MS(1); } if (Y==2) { CD=UART1_READ(); CDX[0]=CD; CDXX=ATOI(CDX); LCD_CHR(1,8,CD); LCD_CHR(2,9,CD); DELAY_MS(1); } if (Y==3) { EF=UART1_READ(); EFX[0]=EF; EFXX=ATOI(EFX); LCD_CHR(1,8,EF); LCD_CHR(2,10,EF); DELAY_MS(1); } if (Y==4) { GH=UART1_READ(); GHX[0]=GH; GHXX=ATOI(GHX); LCD_CHR(1,8,GH); LCD_CHR(2,11,GH); DELAY_MS(1); } if (Y==5) { IJ=UART1_READ(); IJX[0]=IJ; IJXX=ATOI(IJX); LCD_CHR(1,8,IJ); LCD_CHR(2,12,IJ); DELAY_MS(1); } if (Y>=6) { KL=UART1_READ();
169
KLX[0]=KL; KLXX=ATOI(KLX); Y=0; LCD_CHR(1,8,KL); LCD_CHR(2,13,KL); DELAY_MS(1000); LCD_CMD(_LCD_CLEAR); } } } } Skematik hardware alat yang dibuat beserta skematik catu dayanya :
170
Konsep prototype tugas akhir yang telah berhasil diimplementasikan ini sudah pernah diikutsertakan pada kompetisi berskala nasional dibidang teknik elektro bertemakan ketrampilan mikrokontroler dan aplikasi Android yang diadakan oleh Universitas Negeri Malang, Jawa Timur. Dari perlombaan tersebut konsep prototype multipurpose locker system ini (YUKI) berhasil meraih juara 2. Berikut foto moment setelah pengumuman juara:
Kemudian berikut lampiran sertifikat finalis dan sertifikat Juara 2 :
171
172
173
Berikut lampiran topik tentang konsep prototype tugas akhir penulis, multipurpose locker system ( YUKI ) pada media masa :
174
175