#include <io.h>
#include <delay.h> 

unsigned int sum (unsigned int a, unsigned int b);
void delay_s(unsigned int n);
void WaitASec (void);

void main (void)
{    
    DDRB = 0xFF;
    DDRA = 0xFF;
                     
    PORTA = sum(1, 2);
    
    while(1)
    {
        delay_s(2);
        PORTB = ~PORTB;
    }
}


void WaitASec (void)
{
    delay_ms(1000);    
}

void delay_s(unsigned int n)
{
    while(n)
    {      
        n--;
        delay_ms(1000);
    }    
}

