立即注册 登录
返回首页

uid:265598的个人空间

日志

出租车计价器系统设计资料(完整版包括原理图和程序,实物图)

已有 982 次阅读2018-12-9 14:03

原理图

实物图

部分程序

#include<reg52.h>

#define uchar unsigned char

sbit P3_4=P3^4;

//code uchar tab[10]={0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0x00,0x10,};

//code uchar tab[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,};

code uchar tab[10]={0xbf,0x86,0xdb,0xcf,0x66,0xed,0xfd,0x87,0xff,0xef,};

uchar sz[4];

int qw,bw,sw,gw,a,b,c;

void disp(void)

{

for(c=3;c>=0;c--)

{

SBUF=tab[sz[c]];

while(!TI);

TI=0;

}

}

void scjs(void)interrupt 3

{

TH1=0X3C;

TL1=0xB0;

a=a+1;

if(a==2)

{

a=0;

P3_4=!P3_4;

if(P3_4==0)

{

b=TH0*256+TL0;

///yw=sz[0]=b/100000;

//ww=sz[0]=b/10000%10;

qw=sz[0]=b/1000%10;

bw=sz[1]=b/100%10;

sw=sz[2]=b/10%10;

gw=sz[3]=b%10;

disp();

}

}

}

main()

{

TMOD=0x15;

IE=0X88;

TH1=0X3C;

TL1=0XB0;

TR0=1;

TR1=1;

a=0;

while(1);

}

 


























路过

鸡蛋

鲜花

握手

雷人

评论 (0 个评论)

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

返回顶部