Monday, 19 October 2015

PIC16F877A DEFINE MACROS

#include<pic.h>
#include<htc.h>
#define __PIC16F877A_H
#define led PORTDbits.RD0              //define macros
__CONFIG(WDTE_OFF & FOSC_HS);
void delay(unsigned int i)
{
while(i--);
}
void main()
{
TRISDbits.TRISD0=0;
TRISD=0X00;                     //for making output port
while(1)
{
led=1;
delay(20000);
led=0;
delay(20000);
}
}

No comments:

Post a Comment