#include<avr/io.h>
#include<avr/interrupt.h>
#include<avr/signal.h>
#define F_CPU 1000000UL
#include<avr/delay.h>

#define FOR(i,n) for(i=0;i<n;i++)
#define Limit 255
#define Fast  4

int main(void)
{
	
	/* Shows how to use the pins as output
	DDRB = 255 ;
	while(1)
	{
		PORTB = 255 ;
	}
	*/


	
	/* Glow and LED after 1 sec interval 
	DDRB = 255 ;
	char i = 0 ; 
	while(1)
	{
		for ( i = 0 ; i < 100 ;i++ )
		{
			_delay_ms(10);
		}
		PORTB^=255;
	}
	*/

	/* Glow LEDs alternate 
	DDRB = 255 ;
	char i = 0 ; 
	PORTB = 0x02;
	while(1)
	{
		for ( i = 0 ; i < 100 ; i++ )
		{
			_delay_ms(10);
		}
		PORTB ^= 0x03;
	}
	*/
	/* Adjust the brightness level of an LED 
	   DDRB = 3;
	   unsigned char i=0, x = 0,j,k,c=1;
	   while(1)
	   {
		   if ( x==0 )
		   {c=c^1;}

		   FOR(i,Fast)
		   {
			   FOR(j,x);PORTB = c;
			   FOR(k,Limit-x) ; PORTB =c^1;
		   }
		   x++;
	   }

	*/
		
}
