#include "stc15f2k60s2.h"
#include "intrins.h"
#include "ds1302.h"
#define u8 unsigned char
#define u16 unsigned int
code unsigned char tab[]={ 0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e,0xbf};
u8 wtime[3]={1,1,1};
u8 rtime[3]={0};
void clear();
void delayms(u16 xms);
void display();
void main()
{
while(1)
{
P2=0xc0;P0=0x01;
P2=0xe0;P0=tab[1];
delayms(1);
claer();
P2=0xc0;P0=0x02;
P2=0xe0;P0=tab[2];
delayms(1);
claer();
}
}
void delayms(u16 ms)
{
unsigned char i, j;
u16 x;
for(x=ms;x>0;x--)
{
unsigned char i, j;
_nop_();
_nop_();
_nop_();
i = 11;
j = 190;
do
{
while (--j);
} while (--i);
}
}
void clear()
{
P2=P2&0x1f|0xc0;P0=0xff; //wei
P2=P2&0x1f|0xe0;P0=0xff; //duan
}
|