#include <16f877a.h>
#use delay(clock = 20000000)
#fuses hs,noprotect,nowdt,nolvp
#byte PORTB=6
#byte PORTC=7
main()
{
set_tris_b(0);
set_tris_c(0x01);
do{
if (portc==0)
{
portb=0b01010101;
delay_ms(1000);
portb=0b10101010;
delay_ms(2000);
}
else
{
portb=0xFF;
delay_ms(1000);
}
}while(1);
}
Output for the coding..
Compile
No comments:
Post a Comment