Page 172 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 172

11.  소프트웨어  작성하기


             가.  ATmega128에서  데이터  처리를  위한  프로그램  소스  :  codevision  활용
            #asm

                 .equ  __lcd_port  =  0x1b
            #endasm






            //Game  Play  Time  Setting
            #define  GAME_TIME  31  //원하는  시간(sec+1)

            #define  REAL_TIME  62  //Time  Interrupt  시간
            #define  CHECK_TIME  5

            #define  WAIT_TIME  15



            //Moter  Setting
            #define  M_UP                        PORTE=0b00000001;

            #define  M_DOWN                    PORTE=0b00000010;
            #define  M_LEFT                    PORTE=0b00000100;

            #define  M_RIGHT                  PORTE=0b00001000;
            #define  M_STOP                    PORTE=0b00000000;

            #define  M_RIGHT_UP            PORTE=0b00001001;
            #define  M_LEFT_UP              PORTE=0b00000101;

            #define  M_RIGHT_DOWN        PORTE=0b00001010;
            #define  M_LEFT_DOWN          PORTE=0b00000110;



            //Switch  Setting

            #define  START_SW        PINB&0b00000001
            #define  PUT_M_SW        PINB&0b00000010

            #define  UP_M_SW          PINB&0b00000100
            #define  DOWN_M_SW      PINB&0b00001000

            #define  LEFT_M_SW      PINB&0b00010000
            #define  RIGHT_M_SW    PINB&0b00100000








                                                         -  165  -
   167   168   169   170   171   172   173   174   175   176   177