CIRCUIT:
PROGRAM:
#include<p18f452.h>
#pragma config WDT = OFF
void delay(unsigned int);
void main()
{
unsigned char led[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};
unsigned char a;
TRISB=0x00;
while(1){
for(a=0;a<=9;a++)
{
PORTB=led[a];
delay(250);
}
}
}
void delay (unsigned int time){
unsigned char i,j;
for(i=0;i<165;i++)
for(j=0;j<time;j++);
}
PROGRAM:
#include<p18f452.h>
#pragma config WDT = OFF
void delay(unsigned int);
void main()
{
unsigned char led[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};
unsigned char a;
TRISB=0x00;
while(1){
for(a=0;a<=9;a++)
{
PORTB=led[a];
delay(250);
}
}
}
void delay (unsigned int time){
unsigned char i,j;
for(i=0;i<165;i++)
for(j=0;j<time;j++);
}
Comments
Post a Comment