Microcontroller › PIC › Novice at Microcontrollers › do it in this way. don’t
do it in this way.
don’t write anything inside the while (1) loop
befor while loop write a code for turn the led on and after sometimes it go off.
void main()
{
ADCON1=0x0F; // Set all pins as digital I/O
CMCON=0x07; // Set all comparators as digital I/O
TRISEbits.RE0=0; // Configure pin RE0 as output
TRISBbits.RB0=1; // Configure pin RB0 as input
LATEbits.LATE0=1; // Turn the LED On
delay_ms (3000); //3 seconds delay here
LATEbits.LATE0=0; // Turn the LED Off
while(1)
{
;
}
}
If your port settings and the circuit are alright, the led will on first then after 3 seconds it will go off. Please try and update