#include<pic.h>
#include<htc.h>
#define __PIC16F877A_H
__CONFIG(WDTE_OFF & FOSC_HS);
void delay(unsigned int i)
{
while(i--);
}
void main()
{
TRISB=0X00;
TRISD=0X00;
int a,b,c;
PORTD=0x00;
while(1)
{
PORTD=0xf0;
while(PORTD==0xf0);
a=PORTD;
PORTD=0x0f;
b=PORTD;
c=a|b;
PORTB=c;
}
}
No comments:
Post a Comment