Tuesday, May 14, 2013

Led blinking program with pic16f887 and mikroC PRO for PIC

Led blinking program with pic16f887 and mikroC PRO for PIC

 

Description

The following program flashes 8 LEDs on  the PORTC pins of the pic16f887.

Source Code

void main() {
PORTC=0;  //initialize portc
TRISC=0b00000000;   //configure portc as output
ANSELH=0;    //configure an pin as digital I/O
ANSEL=0;
while(1){
PORTC=~PORTC;     //toggle portc
delay_ms(10000);   //1s delay
}
}

http://vshamu.files.wordpress.com/2011/01/ledblinking.png

 

No comments:

Post a Comment