CHASING LEDs
In this project 8 LEDS are connected to PORTC of PIC 18F452 microcontroller andthe microcontroller is operated from a 4MHz resonator. The program turns on the
LEDs in a sequencial manner with a 1 second delay between each input. The net
result is that the LEDs seems to be chasing each other.
Video caption
Don't forget to subscribe
The code below is written in mikroC PRO for PIC.
Author; Ek electrical technologies.
Date; 16TH July 2019
File; CHASING_LEDS.C
*******************************************************************************/
void main() {
unsigned char J=1 ;
TRISC=0X00; // configure PORTC as Output
PORTC=0X00; // initialise PORTC, LEDs OFF
for(;;) // endless loop
{ PORTC= J; // send J to PORTC
DELAY_MS(1000); // delay 1 second
J=J<<1; // shif left J
if(J==0) J=1; // if last LED, move to first LED
}
}
To watch step by step procedure, Click here
Don't forget to subscribe