赞
踩
#include
#define uint unsigned int
#define uchar unsigned char
sbit k1=P1^0;
uchar code table0[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};//LED从低位往高位移
uchar code table1[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};//LED从高位往低位移
uchar code table2[]={0xfe,0xfc,0xf8,0xf0,0xe0,0xc0,0x80,0x00};//LED从1个亮到8个都点亮(从低位往高位)
uchar code table3[]={0x7f,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00};//LED从1个亮到8个都点亮(从高位往低位)
uchar i,tm;
uchar num=0;
void disp1();
void disp2();
void disp3();
void disp4();
void delay_ms(unsigned int tim); //延时函数
void t0isr() interrupt 1
{
TH0=(65536-50000)/256;
TL0=(65536-50000)%256;
tm++;
if(tm>=10)
{
tm=0;
switch(num)
{
cas
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。