I solved this problem with pick it two give it a try!
TEST CODE "PATTERN BLINKING LIGHT"
#include <16F877A.h>
//We use an xtal crystal, no watchdog,
//no low-voltage protection and no code protection.
#fuses XT, NOWDT, NOLVP, NOPROTECT
//The crystal is at 4,000,000 Hz.
#use delay (clock=4M)
//This is the counter for the for loop.
int j;
//This is the starting point of the program.
void main()
{
//Infinite loop.
while(1)
{
//Pattern of blinking LEDs on port C.
for (j=0;j<5;j++)
{
//Send a binary byte to port C
//every 500 milliseconds.
output_c(0b10000001);
delay_ms(500);
output_c(0b01000010);
delay_ms(500);
output_c(0b00100100);
delay_ms(500);
output_c(0b00011000);
delay_ms(500);
output_c(0b00000000);
delay_ms(500);
}
}
}
Check out my video
No comments:
Post a Comment