Page 175 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 175
{
if(LEFT_LIMIT) M_STOP;
else M_LEFT;
}
else if(RIGHT_M_SW)
{
if(RIGHT_LIMIT) M_STOP;
else M_RIGHT;
}
else M_STOP;
}
void main(void)
{
DDRA = 0xff; //Lcd Port
DDRB = 0x00; //Switch port
DDRC = 0x00; //Sensor port
DDRD = 0b10000000; //Signal port
DDRE = 0xff; //Motor port
DDRF = 0xff; //Fnd port
TIMSK = 0x01;
TCCR0 = 0x07;
TCNT0 = 0x00;
SREG = 0x80;
lcd_init(16);
delay_ms(5000);
while (1)
{
switch(game_state)
{
case INIT :
{
- 168 -