Hi, can you guys tell me what's wrong in this C code.
I'm trying to output LED when input from push button is one .
Code:
#include <pic1687x.h>
#include<pic.h>
void main(void)
{
TRISA = 0xFF; //analog input
TRISE = 0xFF; //analog input
TRISB = 0x00;
TRISC = 0x00;
TRISD = 0x00;
ADCON1 = 0x00; //port A and E as analog io
ADCON0 = 0x00;
ADGO = 1;
while(ADGO)
continue;
RBIE = 1; // enable Port B change interrupt
PEIE = 1; // enable peripheral interrupt
GIE = 1;
PORTB = 0x00;
PORTC = 0x00;
PORTD = 0x00;
while(1)
{
if(RA0 == 1) //INPUT FROM PUSH BUTTON
{
RC0=1; // OUTPUT TO LED
RC1=1;
}
else
{
PORTC =0x00;
}
}
}
I'm trying to output LED when input from push button is one .