Page 567 - 2
P. 567

void xy(unsigned int x,unsigned int y)     //LCD xy 좌표 설정 함수
            {
                unsigned int i;
                lcd_cmd(0x02);      //LCD 의 커서를 0,0    으로 설정
                if(y == 1)         //Y 가 1 일 경우
                lcd_cmd(0xc0);       //LCD 의 커서를 x,1    으로 설정
                for(i=0;i<x;i++)   //x 축만큼 오른쪽으로 시프트 하도록 설정.
                {
                    lcd_cmd(0x14);
                }
            }


            void main(void)
            {
                lcd_init();    //LCD 초기화 및 PORT     출력 설정함수 사용


                while(1)
                {


                    if(timestart == 1)     //timestart 가 1 일경우,ccnt 를 1 으로 설정
                    {
                        ccnt = 1;
                    }
            }
            }
            interrupt [EXT_INT4] void asd(void)             // 외부인터럽트 4     번
            {
                if(start == 0)           //START  가 0 일 경우 빨간불이 들어오고,           , LCD 를 초기화시킨 뒤에,times
            tart 를 1 로 설정 하고, 4,0   번지에 START^^b     라는 문자 출력
                {   start = 1;
                    RED = 1;
                    lcd_cmd(CL);
                    xy(4,0);
                    lcd_str("START^^b");
                    timestart = 1;
                }
            }


            interrupt [EXT_INT5] void clear(void)             // 외부인터럽트 5    번
            {
                PORTF = 0x01;                                  //PORTF  를 0x01  로 설정하고 시프트 좌측시프트
                                                             시킨 뒤에, LCD    를 초기화 하고 -CLEAR:D-         를 작성
                ccnt = 0 ;
                timestart = 0;


                                                         - 567 -
   562   563   564   565   566   567   568   569   570   571   572