#include
#include
#define uchar unsigned char
#define uint unsigned int
void timer1_init(void);
void display1(uchar FirstBit,uchar Num);
void display2(uchar FirstBit,uchar Num);
void display3(uchar FirstBit,uchar Num);
void display4(uchar FirstBit,uchar Num);
void Delayms(uint MS);
uchar TempData1[8];
uchar TempData2[8];
uchar TempData3[8];
uchar WeiMa[8] = {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
uchar led_discode[11]={0xc0,0xf9,0xa4,0xb0,0x99,
uchar temp=0x01;
uint num=0,fen=19,shi=20;
void main(void)
{
DDRA=0XFF;
PORTA=0XFF;
DDRC=0XFF;
PORTC=0XFF;
DDRF|=0X0E;
PORTF|=0X0E;
PORTF&=0xF7;
DDRB |=0X10;
PORTB|=0X10;
timer1_init();
SEI();
{
display1(6,2);
display2(3,2);
display3(0,2);
display4(2,1);
display4(5,1);
}
}
void timer1_init(void)
{
}
#pragma interrupt_handler timer1_ovf_isr:15
void timer1_ovf_isr(void)
{
TCNT1H = 0xE1;
if(num==60)
{
fen++;
if(fen==60)
{
shi++;
if(shi==24)
{
}
}
}
}
void display1(uchar FirstBit,uchar Num)
{
for(i=0;i
{
PORTC=led_discode[10];
Delayms(2);
}
}
void display2(uchar FirstBit,uchar Num)
{
for(i=0;i
{
PORTC=led_discode[10];
Delayms(2);
}
}
void display3(uchar FirstBit,uchar Num)
{
for(i=0;i
{
PORTC=led_discode[10];
Delayms(2);
}
}
void display4(uchar FirstBit,uchar Num)
{
for(i=0;i
{
PORTC=led_discode[10];
Delayms(2);
}
}
void Delayms(uint MS)
{
}
声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/dianyuan/kaiguan/262318.html