📄 main.c
字号:
#include<reg52.h>
#include<ctype.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<absacc.h>
#include<intrins.h>
#include<stdarg.h>
#include<setjmp.h>
#include<define.h>
#include<delay.h>
#include<set.h>
#include<RS232.h>
#include<LCD.h>
void disp(uchar nnn)
{
uchar su;
uchar temp;
su=nnn;
f1=su&0x0f;
temp=su>>4;f2=temp&0x0f;
if (f1>9) f1+=0x37;
else f1+=0x30;
if (f2>9) f2+=0x37;
else f2+=0x30;
}
void disp5(uint nn)
{
uint su;
uint temp;
all+=nn;
su=all;
n1=su/10000; temp=su%10000;
n2=temp/1000; temp=temp%1000;
n3=temp/100; temp=temp%100;
n4=temp/10; temp=temp%10;
n5=temp;
if (n1>9) n1+=0x37;
else n1+=0x30;
if (n2>9) n2+=0x37;
else n2+=0x30;
if (n3>9) n3+=0x37;
else n3+=0x30;
if (n4>9) n4+=0x37;
else n4+=0x30;
if (n5>9) n5+=0x37;
else n5+=0x30;
}
void main()
{
LEDY=0;LEDR=0;LEDG=0;delayms(60);
LEDY=1;LEDR=1;LEDG=1;delayms(60);
LEDY=0;LEDR=0;LEDG=0;delayms(60);
LEDY=1;LEDR=1;LEDG=1;delayms(60);
forreceive=0;
sign=9;
all=0;
initialize_LCD() ;
set_RS232();
delayms(100);
line_dis(0x80,&line1);
line_dis(0xc0,&line2);
line_dis(0x94,&line3);
line_dis(0xd4,&line4);
delayms(100);
while(1)
{
if(sign==0) //初始化
{
disp(str[0]);
single_dis(1,18,f2); delayms(1);
single_dis(1,19,f1); delayms(1);
disp(str[1]);
single_dis(2,5,f1); delayms(1);
disp(str[2]);
single_dis(2,15,f1); delayms(1);
disp(str[3]);
single_dis(3,10,f2);delayms(1);
single_dis(3,11,f1);
disp(str[3]);
single_dis(3,12,f2);delayms(1);
single_dis(3,13,f1);delayms(1);
forreceive=0;
sign=6;
str[4]=8;
}
if(sign==1) //抄写完成后
{
disp(str[0]);
single_dis(2,5,f1);
disp(str[1]);
single_dis(2,15,f1);
disp(str[2]);
single_dis(3,10,f2); delayms(1);
single_dis(3,11,f1);
disp(str[3]);
single_dis(3,12,f2); delayms(1);
single_dis(3,13,f1);
disp5(str[0]);
single_dis(4,10,n1); delayms(1);
single_dis(4,11,n2); delayms(1);
single_dis(4,12,n3); delayms(1);
single_dis(4,13,n4); delayms(1);
single_dis(4,14,n5);
forreceive=0;
sign=6;
str[4]=8;
}
sign=str[4];
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -