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

void main(void)
{       
    unsigned char counter = 0;   

    // Input 
    //DDRC = ~(1 << 3);
    DDRC.3 = 0;
    // Pullup  
    //PORTC |= (1 << 3);
    PORTC.3 = 1;   
    
    DDRA = 0xFF;
    
    while(1)
    {                  
        if(PINC.3 == 0)
        {          
            while(PINC.3 == 0)
            {                 
                // do nothing
            }   
            
            PORTA = 1 << counter;
            counter++;      
            if(counter >= 8)
            {              
                counter = 0;
            }
                                         
        }                
    }
}
   