denujith
Member level 5
Hi Everybody,
I have connected 4 LEDs to RB7, RB6, RB5 and RB4 pins of PIC18F2550 via a 470 ohm resistor. My intension is to blink LED one after the other.
My C code is:
But LED connected to RB5 is not blinking. Can any one of you please let me know any reason as to why RB5 LED is not blinking?
Regards,
/Lakmal
I have connected 4 LEDs to RB7, RB6, RB5 and RB4 pins of PIC18F2550 via a 470 ohm resistor. My intension is to blink LED one after the other.
My C code is:
Code:
#include <pic18.h>
#include <18f2550.h>
#pragma config FOSC = INTOSCIO_EC
#pragma config WDT = OFF
void delay (unsigned int interval){
unsigned int i;
for ( i=0; i!=interval; i++ );
}
void main(){
char dir;
TRISB = 0;
PORTB = 0;
while(1)
{
RB4 = 0;
RB7 = 1;
delay(2000);
RB7 = 0;
RB6 = 1;
delay(2000);
RB6 = 0;
RB5 = 1;
delay(2000);
RB5 = 0;
RB4 = 1;
delay(2000);
}
}
But LED connected to RB5 is not blinking. Can any one of you please let me know any reason as to why RB5 LED is not blinking?
Regards,
/Lakmal