/*
 * Amol_Input_device
 *
 * Created: 27-April-17 8:28:27 AM
 * Author : Amol Wadkar
 */ 

//#defines
#define F_CPU 1000000  //Define clock speed as 1Mhz


//Include Header 
#include <avr/io.h>    //Import header file required for AVR microcontroller
#include <util/delay.h>  //Import header file required for delay function


int main(void)
{
	unsigned long i, j ;
	DDRA = 0b10000000;  //set PA7as output & all other pins as input
	while (1) //Repeat the below actions continuously
	{
		if((PINA & (1<<3))==0b00000000) //When magnetic sensor is in NC
		{
			PORTA |= (1<<7);// Set PA7 high (Make LED ON)   
				for( i = 0;	i < 1 ; i++ )
				{
					for(j = 0; j < 90000; j++)
					{
					}
				}		
			PORTA &= ~(1<<7);
				for( i = 0;	i < 1 ; i++ )
				{
					for(j = 0; j < 90000; j++)
					{
					}
				}
		}
		else
		PORTA &= ~(1<<7);// Set PA7 low (Make LED OFF)
	}
}

