램프 켜는것부터 배우는데 코드 봐도 잘 모르겠어요
설명좀 부탁드려요ㅠ
#include <avr/io.h>
void Delay_us(unsigned char time_us)
{ register unsigned char i;
for(i = 0; i < time_us; I++)
{asm volatile(" PUSH RO ");
asm volatile(" POP RO ");
asm volatile(" PUSH RO ");
asm volatile(" POP RO ");
asm volatile(" PUSH RO ");
asm volatile(" POP RO ");
}
}
void Delay_ms(unsigned int time_us)
{ register unsigned int i;
for (i = 0; i < time_ms; I++)
{ Delay_us (250);
Delay_us (250);
Delay_us (250);
Delay_us (250);
}
}
int mian(void)
{
int iDelay=250;
char b = 0;
DDRA = 0x00;
DDRB = 0xFF;
PORTA=0xFF;
while(1)
{
b = PINA;
b&=0x0F;
PORTB=b;
Delay_ms(iDelay);
}
}