Page 132 - 2
P. 132
{
for(i=0;i<=3;i++){
for(j=0;j<=4;j++){
PORTB.4 = 1;
delay_us(13);
PORTB.4 = 0;
delay_us(13);
}
delay_ms(8);
}
}
void Shutdown()// 셧다운(PCB 기판 정지)
{
PORTC=0;
SREG = 0x00;
for(i=0;i<4;i++)
{
PORTA.1 = 0;
delay_ms(500);
PORTA.1 = 1;
delay_ms(500);
}
}
void Stop()// 모터 정지
{
PORTC.0=0;
PORTC.1=0;
PORTC.2=0;
PORTC.3=0;
}
void Forward()// 모터 전진
{
PORTC.0=1;
PORTC.1=0;
PORTC.2=1;
PORTC.3=0;
}
void Backward()// 모터 후진
{
PORTC.0=0;
PORTC.1=1;
PORTC.2=0;
- 132 -