Page 13 - 완) I MDP 프로젝트 작품 보고서(전체과 1학년)1.6
P. 13
void main(void)
{
DDRA = 0x00;
PORTA = 0xff;
DDRE=0x00;
DDRB=0xff;
DDRF = 0xff;
DDRD = 0xff;
DDRG = 0xff;
EICRB = 0b00001010;
EIMSK = 0b00110000;
TIMSK = 0x01;
TCNT0 = 0x00;
SREG|=0x80;
while(1){
TCCR0 = 0x07;
if (PINA.0==1)
{
SREG = 0x00;
time = 30;
count = 0;
}
for (i=0;i<2;i++)
{
SREG|=0x80;
DDRA = 0x00;
PORTA = 0xff;
DDRE=0x00;
DDRB=0xff;
DDRF = 0xff;
DDRD = 0xff;
DDRG = 0xff;
- 6 -