Tuesday, 29 September 2015

Program to Blink PORTC when TIMER0 overflows....



#include<pic.h>
void delay(int);
void main()
{
TRISC=0X00;
OPTION=0X07;
TMR0=0X00; 
while(TMR0IF==0);
while(1)
{
PORTC=0XFF;
delay(10);
PORTC=0X00;
delay(10);
}
}
void delay(int k)
{
int j,i;
for(i=0;i<k;i++)
for(j=0;j<1000;j++);
}

No comments:

Post a Comment