程序:
#include //头文件
#define uint unsigned int //
#define uchar unsigned char
sbit lcden=P2^3; //定义引脚
sbit rs=P2^4;
sbit rw=P2^0;
sbit busy=P0^7;
char i,j,temp,num,num_1;
long a,b,c; //a,第一个数 b,第二个数 c,得数
float a_c,b_c;
uchar flag,fuhao;//flag表示是否有符号键按下,fuhao表征按下的是哪个符号
uchar code table[]={
7,8,9,0,
4,5,6,0,
1,2,3,0,
0,0,0,0};
uchar code table1[]={
7,8,9,0x2f-0x30,
4,5,6,0x2a-0x30,
1,2,3,0x2d-0x30,
0x01-0x30,0,0x3d-0x30,0x2b-0x30};
void delay(uchar z) // 延迟函数
{
uchar y;
for(z;z>0;z--)
for(y=0;y