//tri hoan 'h' giờ:
void delay_hour(unsigned char h)
{
unsigned int m;
do{
m=3600; //60x60
do{delay_ms(1000);}
while(--m);
}
while(--h);
}
void main(void)
{
P1=255;
while(1)
{
P11=~P11;
delay_hour(4);
}
}
void delay_hour(unsigned char h)
{
unsigned int m;
do{
m=3600; //60x60
do{delay_ms(1000);}
while(--m);
}
while(--h);
}
void main(void)
{
P1=255;
while(1)
{
P11=~P11;
delay_hour(4);
}
}
Comment