Monday, 19 October 2015

PIC16F877A LED SHIFTING

#include<pic.h>
#include<htc.h>
#define __PIC16F877A_H
__CONFIG(WDTE_OFF & FOSC_HS);
void delay(unsigned int i)
{
while(i--);
}
void main()
{
int i;
TRISD=0X00;                                      //for making output port
while(1)
{
for(i=0;i<=3;i++)
{
PORTD=((0x10<<i)|(0X08>>i));
delay(4000);
}
}
}

No comments:

Post a Comment