I have developed a code below for glowing LED (on port PH2) whenever switch is pressed (on PAD08). But it doesn't working.
Attached is the Schematic of the same.
#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
DDRH_DDRH2=1; /* PH2-LD2 as Output */
DDR0AD0_DDR0AD00=0; /* PAD08 as Input */
if(PT0AD0_PT0AD00!=0b1) /* Check switch on PAD08 */
PTH_PTH2= 1; /* LED ON */
PTH_PTH2= 0; /* LED OFF */
unsigned int i,j;