微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 嵌入式设计讨论 > MCU和单片机设计讨论 > 新手求助51单片机计算程序wenti

新手求助51单片机计算程序wenti

时间:10-02 整理:3721RD 点击:
这个程序按键显示多个按1显示111111还有求欢迎界面文字字模输入
#include<reg51.h>
#include<stdio.h>
#include<math.h>
#define uint unsigned int
#define uchar unsigned char
#define lcd P2
uchar i=0,j=0,k=0,fuhao=0,fhjh=0,v=0;
bit flagy=0,flagdeng=0,flagd=0,flagshu=0,flagjian=0,flagfu=0,flagliansuanfuhao=0,flagb8=0,flagfhshu=0,flagb80=0;
uchar a1[4],a2[4],a3[4],a4[4],b[16],x[8],y[8],c[8];
sbit cs1 = P3^4;   
sbit cs2 = P3^3;   
sbit rw = P3^1;   
sbit rs = P3^2;   
sbit e= P3^0;     
sbit busy=ACC^7;
uchar code ling[64]={0x00,0xFC,0xFC,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0xFC,0xFC,0x00,
0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,
0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,
0x00,0x3F,0x3F,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x3F,0x3F,0x00,};
uchar code yi[64]={0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0x01,0x01,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x38,0x38,0x3F,0x3F,0x3F,0x38,0x38,0x00,0x00,0x00,0x00,};
uchar code er[64]={0x00,0x3C,0x3C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0xFC,0xFC,0x00,
0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xFF,0xFF,0x00,
0x00,0xFF,0xFF,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,
0x00,0x3F,0x3F,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x3C,0x3C,0x00,};
uchar code san[64]={0x00,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0xFC,0xFC,0x00,
0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xFF,0xFF,0x00,
0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0xFF,0xFF,0x00,
0x00,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x3F,0x3F,0x00,};
uchar code si[64]={0x00,0xFC,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0xF8,0x00,
0x00,0xFF,0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xFF,0xFF,0x00,
0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0xFF,0xFF,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x3F,0x00,};
uchar code wu[64]={0x00,0xFC,0xFC,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x00,
0x00,0xFF,0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,
0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0xFF,0xFF,0x00,
0x00,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x3F,0x3F,0x00,};
uchar code liu[64]={0x00,0xFC,0xFE,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xFF,0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,
0x00,0xFF,0xFF,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0xFF,0xFF,0x00,
0x00,0x7F,0x7F,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x70,0x7F,0x7F,0x00,};
uchar code qi[64]={0x00,0x38,0x3C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0xFC,0xFC,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x60,0x70,0x7F,0x7F,0x40,};
uchar code ba[64]={0x00,0xFC,0xFC,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0xFC,0xFC,0x00,
0x00,0xFF,0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xFF,0xFF,0x00,
0x00,0xFF,0xFF,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0xFF,0xFF,0x00,
0x00,0x3F,0x3F,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x3F,0x3F,0x00,};
uchar code jiu[64]={0x00,0xFC,0xFC,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0xFC,0xFC,0x00,
0x00,0xFF,0xFF,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xFF,0xFF,0x00,
0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0xFF,0xFF,0x00,
0x00,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x3F,0x3F,0x00,};
uchar code jia[64]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xC0,0x40,0x40,0x40,0x40,0x7E,0x02,0x7E,0x40,0x40,0x40,0x40,0x40,0xC0,0x00,
0x00,0x01,0x01,0x01,0x01,0x01,0x3F,0x20,0x3F,0x01,0x01,0x01,0x01,0x01,0x01,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code jian[64]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xC0,0xC0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xC0,0xC0,0x00,
0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
uchar code chen[64]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xC0,0x40,0x58,0x78,0x70,0x7E,0x02,0x7E,0x30,0x78,0x58,0x40,0x40,0xC0,0x00,
0x00,0x01,0x01,0x0D,0x0F,0x07,0x3F,0x20,0x3E,0x07,0x0F,0x0D,0x01,0x01,0x01,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code chu[64]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0xC0,0xC0,0x40,0x40,0x40,0x50,0x78,0x50,0x40,0x40,0x40,0x40,0xC0,0xC0,0x00,
0x00,0x01,0x01,0x01,0x01,0x01,0x05,0x0F,0x05,0x01,0x01,0x01,0x01,0x01,0x01,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code deng[64]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,
0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code dian[64]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x38,0x7C,0x7C,0x7C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code qing[64]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code cuo[64]={0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x7F,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x06,0x0F,0x1F,0x0F,0x06,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code chushu[]={0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,
0x00,0xC0,0xE0,0xE0,0xE0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0x60,0xE0,0xE0,0xE0,0xC0,0xC0,0xC0,0x40,
0x00,0xE0,0xE0,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x71,0xFF,0xFF,0xEF,0x73,0x78,0x3E,
0x3F,0x3F,0xF7,0xF3,0xF7,0x3F,0x3F,0x3E,0x3C,0x78,0x78,0x10,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xCE,0xEF,0xFF,0x7D,0xFD,0xFF,0xFF,0xFD,0xFF,0xFF,0xEF,0xFE,
0xFF,0xFF,0xDF,0x0F,0x0E,0xFE,0xFE,0xFE,0x0E,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x38,0x39,0x3F,0xBF,0xDF,0xE7,0xFF,
0x7F,0x37,0xFF,0xFF,0xFF,0x37,0x7F,0xFF,0xF7,0xE7,0x80,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x06,0x06,0x37,0x3E,0xFF,0xFF,0xF7,0xE7,0xFE,0xFE,0xFE,0xC6,0x41,
0x81,0xCF,0xFF,0xFE,0xFF,0xFF,0xDF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x07,0x00,0x00,0x00,0x01,0x03,0x03,0x01,
0x03,0x07,0x07,0x07,0x03,0x00,0x00,0x00,0x03,0x03,0x01,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x06,0x06,0x07,0x07,0x07,0x03,0x03,0x01,0x00,0x01,0x07,0x07,0x07,
0x07,0x03,0x03,0x01,0x01,0x03,0x07,0x07,0x07,0x03,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code buneng[]={0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xE0,0x60,0x80,0x80,0x00,0x00,0xE0,0xE0,0xE0,
0x00,0x00,0x80,0xC0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x81,0xC1,0xE1,0xF1,0xFD,0xFF,
0xFF,0x4F,0xE3,0xE1,0xE1,0xC1,0x81,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x1C,0xDE,0xDF,0xDF,0xDB,0xD9,0xDF,0xDF,0xDF,0xFE,0x1C,0xBF,0xFF,0xFF,
0x77,0x67,0x63,0x73,0x7D,0x7D,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3E,0x1E,0x0F,0x0F,0x07,0x03,0x01,0xFF,0xFF,
0xFF,0x00,0x00,0x01,0x03,0x07,0x0F,0x1F,0x1E,0x1C,0x08,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xFF,0xFF,0xFF,0x76,0x76,0x76,0xFF,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,
0x1C,0x1C,0x1E,0x0E,0xCF,0xC6,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,
0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x07,0x07,0x07,0x00,0x00,0x06,0x07,0x07,0x07,0x00,0x03,0x03,0x07,
0x07,0x07,0x07,0x07,0x07,0x07,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code weiling[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0xF0,0xF0,0xF0,0x80,
0xC0,0xF8,0xF8,0xF8,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x0E,0x0E,0x0E,0x0C,0x0D,0x8D,0xED,
0xFF,0xFF,0xBF,0x8F,0x0C,0x0C,0x0C,0xCC,0xFC,0xFC,0xFC,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xE0,0xFE,0xFF,0xFF,0x0F,0x03,0x03,0x07,0xFF,0xFF,0xFE,
0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xE0,0xF0,0xF8,0x7C,0x3E,0x1F,0x0F,
0x07,0x01,0x07,0xCF,0xCF,0xCE,0xC0,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x03,0x1F,0x7F,0xFF,0xF8,0xE0,0xE0,0xF0,0xFF,0x7F,0x3F,
0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code gantan[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xC0,0x80,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xC0,0xC0,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xFF,0x1F,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFF,0x7F,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x79,0x7F,0x7B,0x30,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x7B,0x7B,0x78,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x7B,0x7B,0x78,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code chaochu[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0xF8,0xF0,0x30,0x00,
0x00,0x80,0xC0,0xC0,0xC0,0xC0,0xE0,0xE0,0xE0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0xF0,0x20,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x60,0xF6,0xF6,0xB7,0xFF,0xFF,0xFB,0x9B,
0xFB,0xF0,0xFC,0xDF,0xCF,0xDF,0xF8,0xFF,0xCF,0xC1,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xC0,0xF6,0xFE,0xFE,0xE0,0x60,0x60,0xFF,0xFF,0xFF,0x30,0x30,0x30,
0xFF,0xFF,0x7E,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x60,0x70,0x38,0x3C,0x1F,0x07,0x07,0x0F,0x1F,0x1D,0x39,
0x38,0x70,0x7F,0xFF,0xEC,0xE6,0xE7,0xE7,0xC7,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,
0x00,0x00,0x00,0xE0,0xF7,0xFF,0xFE,0x6C,0x60,0x60,0x7F,0x3F,0x3F,0x30,0x30,0x30,
0x3E,0xFE,0xFE,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code jisuan[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0x80,0x00,0x00,0x00,
0x00,0xE0,0xE0,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE0,0xF8,0xF8,0x30,0x30,0x30,0xA0,0xC0,0xF8,
0xF8,0xB0,0xB0,0x30,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x60,0xE0,0xE0,0x60,0x70,0xF9,0xFB,0x73,0x43,0xC0,0xC0,0xE0,
0x60,0x60,0xFF,0xFF,0x70,0x70,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x06,0x07,0x03,0xFD,0xFF,0x57,0x56,0x57,0x57,0x57,0xFE,
0xFE,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x7E,0x7F,0x3F,0x1C,0x0C,0x0E,0x06,0x00,
0x00,0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x10,0x38,0x38,0x18,0x18,0xD8,0xFB,0xFF,0x3F,0x0D,0x0D,0x0D,0xFF,0xFF,
0xFF,0x0C,0x0E,0x0E,0x0E,0x0E,0x0E,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x3F,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x04,0x06,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x0F,0x0F,
0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code fanwei[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0x00,0x00,
0x00,0xA0,0xE0,0xE0,0xE0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xC0,0xC0,
0xC0,0xC0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x86,0x86,0x66,0xE6,0xE6,0xE7,0x1F,0xFF,0xE3,0xE3,
0x7F,0x7F,0xE7,0xF3,0xE3,0x63,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0xFF,0xFF,0x01,0x09,0x6D,0x6D,0xFF,0xFF,0x6D,0x6D,0xEE,0x8C,
0x80,0x03,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0xC3,0xC7,0xF7,0xFE,0x3E,0x0E,0x00,0x7F,0xFF,0xFF,
0x86,0x8E,0x0F,0x0F,0x07,0x00,0x80,0xC0,0xF8,0xF8,0x80,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xC0,0xFF,0xFF,0xC0,0xC3,0xC3,0xC3,0xFF,0xFF,0xC1,0xDD,0xF9,0xFF,
0xCF,0xC0,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x03,0x01,0x00,0x00,0x00,0x00,0x01,0x03,
0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x07,0x07,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code huanying0[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x90,0xF0,0xF0,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,
0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code huanying1[]={0x00,0x00,0x00,0x00,0x00,0x08,0x18,0x7C,0xEC,0xCC,0xEE,0xFE,0xFE,0x7C,0x78,0x3E,
0xFF,0xEF,0xEF,0x0C,0x3C,0x3E,0x3E,0x1C,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xC0,0xC0,0xC3,0xE7,0xEF,0xEF,0xC6,0x0C,0xFC,0xFE,0x87,0xC7,0xC7,
0xFD,0xFC,0xCC,0xCE,0xFE,0xFE,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code huanying2[]={0x00,0x00,0x00,0x00,0x00,0xC0,0xE0,0x70,0x3C,0x1F,0x0F,0x8F,0xDF,0xDC,0xF0,0x7C,
0x3F,0x1F,0x07,0x1F,0x3C,0xF8,0xF0,0xE0,0xE0,0xC0,0xC0,0x80,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x60,0x60,0x60,0x67,0x3F,0x3F,0x60,0x60,0x6F,0xEF,0xE3,0xC1,0xC0,
0xFF,0xFF,0xC0,0x83,0x83,0x83,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,};
uchar code huanying3[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,
0x01,0x03,0x03,0x03,0x03,0x03,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code shiyong0[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0xE0,0xE0,0x00,0x00,0x00,0x00,
0xF8,0xF8,0xF0,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xE0,0x60,0x60,0x60,
0xE0,0xE0,0xE0,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code shiyong1[]={0x00,0x00,0x00,0xC0,0xE0,0xF0,0x78,0x3E,0xFF,0xFF,0x03,0x18,0x78,0xFB,0xFB,0xDB,
0xFF,0xFF,0xFF,0xCD,0xFD,0xFD,0x3D,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xC8,0xCC,0xFF,0xFF,0xFF,0xCC,0xCC,0xC4,
0x01,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code shiyong2[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0xFF,0x7F,0xC0,0x61,0x73,0x7B,0x3F,0x1F,
0x1F,0x1F,0x38,0x78,0xF0,0xF0,0xE0,0xE0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,
0x00,0xC0,0xE0,0x78,0x7E,0x1F,0x07,0x00,0x00,0x00,0x3F,0x7F,0x1F,0x00,0x20,0x60,
0xE0,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code shiyong3[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code gang[]={0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,
0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,};     
uchar code mei[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code nawandong0[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code nawandong1[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code nawandong2[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code nawandong3[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code ling0[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code ling1[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code ling2[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,                       
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
uchar code ling3[]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};
/*函数申明部分*/
void cuowu(uchar i);
void Tkey(void);
void dispall();
/*写控制字*/
void lcd_wcode(uchar i)                       
{rw=1;
rs=0;
lcd=0;
e=1;
do{ACC=lcd;   
e=0;}
while(busy);
rw=0;
lcd=i;
e=1;
e=0;}
/*写数据*/
void lcd_wdata(uchar i)   
{rw=1;
rs=0;
lcd=0;
e=1;
do{ACC=lcd;
e=0;}
while(busy);
rw=0;
rs=1;
lcd=i;
e=1;
e=0;}
/*选择页*/
void setpos(uchar row , uchar col)
{lcd_wcode(0xb8+row);
lcd_wcode(0x40+col);}
/*屏幕复位*/
void lcd_init(void)
{lcd_wcode(0xc0);
lcd_wcode(0x3f);}
/*输出第一行*/
void disp1(uchar code *hz)   
{uchar i;
for(i=0;i<16;i++)
{lcd_wdata(*(hz+i));}}
/*输出第二行*/
void disp2(uchar code *hz)   
{uchar i;
for(i=16;i<32;i++)
  lcd_wdata(*(hz+i));}

/*输出第三行*/
void disp3(uchar code *hz)   
{uchar i;
for(i=32;i<48;i++)
  lcd_wdata(*(hz+i));}
/*输出第四行*/

void disp4(uchar code *hz)  
{uchar i;
for(i=48;i<64;i++)
  lcd_wdata(*(hz+i));}  
/*选择左右屏幕*/
void select(uchar x)
{switch(x)
  { case 1: cs1=0;cs2=1;break;   
    case 2: cs1=1;cs2=0;break;   
    default:cs2=0;cs2=0;}}
/*输出第一部分*/
void dispyi()
{select(1);   
for(j=0;j<4;j++)
{unsigned int temp;
switch(a1[j])
{case 0:temp=&ling;break;
case 1:temp=&yi;break;
case 2:temp=&er;break;
case 3:temp=&san;break;
case 4:temp=&si;break;
case 5:temp=&wu;break;
case 6:temp=&liu;break;
case 7:temp=&qi;break;
case 8:temp=&ba;break;
case 9:temp=&jiu;break;
case 10:temp=&jia;break;
case 11:temp=&jian;break;
case 12:temp=&chen;break;
case 13:temp=&chu;break;
case 14:temp=&deng;break;
case 15:temp=&dian;break;
case 16:temp=&qing;break;}
setpos(0,j*16);
disp1(temp);  
setpos(1,j*16);   
disp2(temp);
setpos(2,j*16);
disp3(temp);
setpos(3,j*16);   
disp4(temp);}}
/*输出第二部分*/
void disper()  
{select(2);   
for(j=0;j<4;j++)
{unsigned int temp;
switch(a2[j])
{case 0:temp=&ling;break;
case 1:temp=&yi;break;
case 2:temp=&er;break;
case 3:temp=&san;break;
case 4:temp=&si;break;
case 5:temp=&wu;break;
case 6:temp=&liu;break;
case 7:temp=&qi;break;
case 8:temp=&ba;break;
case 9:temp=&jiu;break;
case 10:temp=&jia;break;
case 11:temp=&jian;break;
case 12:temp=&chen;break;
case 13:temp=&chu;break;
case 14:temp=&deng;break;
case 15:temp=&dian;break;
case 16:temp=&qing;break;}
setpos(0,j*16);
disp1(temp);  
setpos(1,j*16);   
disp2(temp);
setpos(2,j*16);
disp3(temp);
setpos(3,j*16);   
disp4(temp);}}
/*输出第三部分*/
void dispsan()
{select(1);   
for(j=0;j<4;j++)
{unsigned int temp;
switch(a3[j])
{case 0:temp=&ling;break;
case 1:temp=&yi;break;
case 2:temp=&er;break;
case 3:temp=&san;break;
case 4:temp=&si;break;
case 5:temp=&wu;break;
case 6:temp=&liu;break;
case 7:temp=&qi;break;
case 8:temp=&ba;break;
case 9:temp=&jiu;break;
case 10:temp=&jia;break;
case 11:temp=&jian;break;
case 12:temp=&chen;break;
case 13:temp=&chu;break;
case 14:temp=&deng;break;
case 15:temp=&dian;break;
case 16:temp=&qing;break;}
setpos(4,j*16);
disp1(temp);  
setpos(5,j*16);   
disp2(temp);
setpos(6,j*16);
disp3(temp);
setpos(7,j*16);   
disp4(temp);}}
/*输出第四部分*/
void dispsi()
{select(2);   
for(j=0;j<4;j++)
{unsigned int temp;
switch(a4[j])
{case 0:temp=&ling;break;
case 1:temp=&yi;break;
case 2:temp=&er;break;
case 3:temp=&san;break;
case 4:temp=&si;break;
case 5:temp=&wu;break;
case 6:temp=&liu;break;
case 7:temp=&qi;break;
case 8:temp=&ba;break;
case 9:temp=&jiu;break;
case 10:temp=&jia;break;
case 11:temp=&jian;break;
case 12:temp=&chen;break;
case 13:temp=&chu;break;
case 14:temp=&deng;break;
case 15:temp=&dian;break;
case 16:temp=&qing;break;}
setpos(4,j*16);
disp1(temp);  
setpos(5,j*16);   
disp2(temp);
setpos(6,j*16);
disp3(temp);
setpos(7,j*16);   
disp4(temp);}}
/*数据进行清理尾部0的处理吧*/
void qingliwei()
{for(i=0;i<7;i++)
{if(b[i]==15)
{while(b[0]==0)
{for(k=0;k<7;k++)
{b[k]=b[k+1];
b[7]=0x00;}
}}}for(i=8;i<15;i++)
{if(b[i]==15)
{while(b[8]==0)
{for(k=8;k<15;k++)
{b[k]=b[k+1];
b[15]=0x10;}
}}}}
/*数据进行头部0的清理*/
void qingliqian()
{uchar ab;
for(ab=7;ab>0;ab--)
{if(((b[ab]==0||b[ab]==0x10))&&b[ab-1]!=15)
{b[ab]=0x10;}      
else{break;}}
for(ab=15;ab>=8;ab--)
{if(((b[ab]==0||b[ab]==0x10))&&(b[ab-1]!=15))
{b[ab]=0x10;}
else{break;}}}
/*数据报送输出*/
void dispall()
{if(flagshu==0)
{qingliwei();}
qingliqian();
if(flagb8==1){b[8]=0;if(flagb80==1)b[8]=0x10;}
a1[0]=b[15];
a1[1]=b[14];
a1[2]=b[13];
a1[3]=b[12];
a2[0]=b[11];
a2[1]=b[10];
a2[2]=b[9];
a2[3]=b[8];
a3[0]=b[7];
a3[1]=b[6];
a3[2]=b[5];
a3[3]=b[4];
a4[0]=b[3];
a4[1]=b[2];
a4[2]=b[1];
a4[3]=b[0];
dispyi();
disper();
dispsan();
dispsi();}
/*延时函数*/
void delay(unsigned char temp)
{unsigned char i,j;
for(j=temp;j>1;j--);
{for(i=temp;i>1;i--);
}}
/*错误时的送显示函数,因为分块和前面不一样*/
void disp01(uchar code *hz)     
{unsigned int i;   
for(i=0;i<256;i++)  
lcd_wdata(*(hz+i));}
/*错误时送显示的函数*/
void cuowu(uchar i)
{if(i==5){
lcd_init();      
select(1);      
setpos(0,0);
disp01(&chushu);   
select(2);      
setpos(0,0);     
disp01(&buneng);
select(1);      
setpos(4,0);
disp01(&weiling);   
select(2);      
setpos(4,0);
disp01(&gantan);}
else if(i==7)
{lcd_init();      
select(1);      
setpos(0,0);
disp01(&chaochu);   
select(2);      
setpos(0,0);     
disp01(&jisuan);
select(1);      
setpos(4,0);
disp01(&fanwei);   
select(2);      
setpos(4,0);
disp01(&gantan);}}   
/*显示欢迎界面的后半段显示*/
void xianshihou(uchar g)//////////////////////////////////////////////////////////////////////////////////////////////////////
{delay(0xff);
lcd_init();
select(2);      
setpos(0,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(shiyong0+i));
select(2);      
setpos(4,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(nawandong0+i));
select(2);      
setpos(1,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(shiyong1+i));
select(2);      
setpos(5,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(nawandong1+i));
select(2);      
setpos(2,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(shiyong2+i));
select(2);      
setpos(6,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(nawandong2+i));
select(2);      
setpos(3,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(shiyong3+i));
select(2);      
setpos(7,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(nawandong3+i));
select(1);      
setpos(0,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(huanying0+i));
select(1);      
setpos(4,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(mei+i));
select(1);      
setpos(1,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(huanying1+i));
select(1);      
setpos(5,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(gang+i));
select(1);      
setpos(2,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(huanying2+i));
select(1);      
setpos(6,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(mei+i));
select(1);      
setpos(3,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(huanying3+i));
select(1);      
setpos(7,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(mei+i));
select(2);      
setpos(0,0);     
for(i=64-g;i<64;i++)  
lcd_wdata(*(huanying0+i));
select(2);      
setpos(1,0);     
for(i=64-g;i<64;i++)  
lcd_wdata(*(huanying1+i));
select(2);      
setpos(2,0);     
for(i=64-g;i<64;i++)  
lcd_wdata(*(huanying2+i));
select(2);      
setpos(3,0);     
for(i=64-g;i<64;i++)  
lcd_wdata(*(huanying3+i));
select(2);      
setpos(4,0);     
for(i=64-g;i<64;i++)  
lcd_wdata(*(mei+i));
select(2);      
setpos(5,0);     
for(i=64-g;i<64;i++)  
lcd_wdata(*(gang+i));
select(2);      
setpos(6,0);     
for(i=64-g;i<64;i++)  
lcd_wdata(*(mei+i));
select(2);      
setpos(7,0);     
for(i=64-g;i<64;i++)  
lcd_wdata(*(mei+i));}
/*显示欢迎界面的前半段显示*/
void xianshiqian(uchar g)  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
{delay(0xff);
lcd_init();
select(2);      
setpos(0,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(huanying0+i));
select(2);      
setpos(1,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(huanying1+i));
select(2);      
setpos(2,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(huanying2+i));
select(2);      
setpos(3,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(huanying3+i));
select(2);      
setpos(4,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(mei+i));
select(2);      
setpos(5,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(gang+i));
select(2);      
setpos(6,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(mei+i));
select(2);      
setpos(7,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(mei+i));
}
/*欢迎界面完后的0的左移出现效果函数*/
   
void xianshiling(uchar g)
{  delay(0xff);
select(2);      
setpos(4,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(ling0+i));
select(2);      
setpos(5,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(ling1+i));
select(2);      
setpos(6,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(ling2+i));
select(2);      
setpos(7,g-1);     
for(i=0;i<65-g;i++)  
lcd_wdata(*(ling3+i));}
/*显示欢迎界面的函数*/
void huanyingjiemian()
{uchar g;
for(i=0;i<10;i++)
{delay(0xff);}
for(g=64;g>0;g--)
{xianshiqian(g);}
for(g=64;g>0;g--)
{xianshihou(g);}
for(i=0;i<15;i++)
{delay(0xff);}
for(g=1;g<65;g++)
{xianshihou(g);}
for(g=1;g<65;g++)
{xianshiqian(g);}
for(i=0;i<18;i++)
{delay(0xff);}
for(g=64;g>0;g--)
{xianshiling(g);}}
/*清理与复位的函数*/
void clear()
{flagy=0;
flagdeng=0;
flagd=0;
flagshu=0;
flagliansuanfuhao=0;
flagjian=0;
fhjh=0;
flagfhshu=0;
v=0;
i=0;
j=0;
k=0;
fuhao=0;
for(i=0;i<8;i++)
{b[i]=0;
b[i+8]=0;
x[i]=0;
y[i]=0;}
flagfu=1;
flagb8=0;flagb80=0;}
/*处理减法的函数*/
float sum(float temp00,temp11)   
{if(fhjh==1)
{temp00=-temp00;}
else{temp00=temp00-temp11;}   
return(temp00);}
/*处理等号(计算结果)的函数*/
void dengdeng()      
{double xshu=0,yshu=0;
unsigned long int temp2;
uchar fhao,n,dianpb;
bit flagdianbiao=0,flagfuhao=0;
flagshu=0;
fhao=fuhao;
fuhao=0;
if(fhao!=0)
{for(n=8;n>0;n--)  //对x[]数组的数据进行读出的处理
{if(x[n-1]==15){dianpb=n-1;flagdianbiao=1;break;}}
if(flagdianbiao==1)
{for(n=dianpb;n<7;n++)
{x[n]=x[n+1];}}
for(n=8;n>0;n--)
{xshu=x[n-1]+xshu*10;}
if(flagdianbiao==1)
{for(n=0;n<dianpb;n++)
{xshu=xshu/10;}
flagdianbiao=0;}
if(flagliansuanfuhao==1)
{xshu=-xshu;
flagliansuanfuhao=0;}
for(n=8;n>0;n--)    //对y[]数组的数据进行读出的处理
{if(y[n-1]==15){dianpb=n-1;flagdianbiao=1;break;}}
if(flagdianbiao==1)
{for(n=dianpb;n<7;n++)
{y[n]=y[n+1];}}
for(n=8;n>0;n--)
{yshu=y[n-1]+yshu*10;}
if(flagdianbiao==1)
{for(n=0;n<dianpb;n++)
{yshu=yshu/10;}
flagdianbiao=0;}
switch(fhao)
{case 10: xshu=xshu+yshu;break;
case 11: xshu=xshu-yshu;break;
case 12: xshu=xshu*yshu;break;
case 13: if(yshu==0x00){flagfu=0;while(flagfu==0){cuowu(5);Tkey();}}xshu=xshu/yshu;break;}
if(xshu>99999999||xshu<-9999999)       //数据的大小判别
{flagfu=0;
while(flagfu==0)
{cuowu(7);
Tkey();}}
if(xshu<0)
{xshu=-xshu;   
flagfuhao=1;}
temp2=xshu;
if(temp2!=xshu)
{v=0;
if(flagfuhao)
{if(xshu<1&&xshu>-1)
{while(xshu<9999&&xshu>-9999)
{xshu=10*xshu;
v=v+1;}}
else
{while(xshu<99999&&xshu>-99999)  //对小数进行的处理
{xshu=10*xshu;
v=v+1;}}}
else{while(xshu<999999&&xshu>-999999)
{xshu=10*xshu;
v=v+1;}}}
temp2=xshu;  
c[7]=temp2%100000000/10000000;   //将的得出的数据放入数组
c[6]=temp2%10000000/1000000;
c[5]=temp2%1000000/100000;        
c[4]=temp2%100000/10000;
c[3]=temp2%10000/1000;
c[2]=temp2%1000/100;
c[1]=temp2%100/10;
c[0]=temp2%10;
if(v!=0)
{for(i=0;i<v;i++)
{c[i]=c[i+1];}
c[v-1]=15;
v=0;}
for(i=0;i<8;i++)
{b[i]=c[i];
x[i]=b[i];
y[i]=0;}
if(flagfuhao==1)
{flagfuhao=0;
for(i=6;i>0;i--)
{if(b[i]==0||b[i]==0x10){}
else{break;}}
if(b[i]==15){b[i+2]=11;b[i+1]=0;}
else
{b[i+1]=11;}
flagliansuanfuhao=1;}
yshu=0;}
qingliwei();
if(b[0]==0x0f)
{for(i=0;i<8;i++)
{b[i]=b[i+1];b[7]=0;}}
flagb8=0;
if(b[0]==0)
{flagb8=1;}}
/*处理等号按键的函数*/
void dengdengyi()
{dengdeng();
v=0;
flagy=0;
flagd=0;
flagfhshu=0;
fhjh=0;
flagdeng=1;
flagliansuanfuhao=0;
flagjian=0;
for(i=0;i<8;i++)
{x[i]=0;
y[i]=0;
b[i+8]=0x10;}
b[15]=14;
flagb8=0;
flagb80=0;
}
/*处理数字输入的函数*/
void shuzi(uchar shu)
{uchar n;
if(flagy==0)
{if((x[6]==0)&&(x[5]!=15))
{if(flagdeng==1)
{flagdeng=0;
b[15]=0;
for(n=0;n<8;n++)
{x[n]=0;
b[n]=0;}}
for(n=6;n>0;n--)
{x[n]=x[n-1];
b[n]=b[n-1];}
flagshu=1;
v=0;
b[0]=shu;
x[0]=shu;}}
else{if((y[6]==0)&&(y[5]!=15)&&b[6]!=11)
{if(b[0]==10||b[0]==12||b[0]==13||(b[0]==11&&flagjian==1))
{for(i=0;i<8;i++)
{b[i+8]=b[i];
b[0]=0;}}
for(n=6;n>0;n--)
{y[n]=y[n-1];
b[n]=b[n-1];}
flagshu=1;
v=0;
b[0]=shu;
y[0]=shu;
if(b[2]==11&&b[1]==0&&b[0]==0)
{b[2]=0;
b[1]=11;
b[0]=0;
}if(b[0]!=15&&b[1]==0&&b[2]==11)
{b[2]=0;
b[1]=11;}}}
flagjian=1;
flagb8=0;
flagfhshu=0;flagb80=0;}

/*处理运算符号输入的函数*/
  
void yun(uchar suan)
{uchar n;
bit fuhaoji;
fhjh++;
flagb80=0;
flagy=1;
flagd=0;
if(flagfhshu==0)
{dengdeng();
flagfhshu=1;
}
for(i=0;i<7;i++)
{if(b[i]!=0)
{fuhaoji=1;break;}}
if(((b[0]==10)||(b[0]==11)||(b[0]==12)||(b[0]==13))||(fuhaoji==0))
{fuhao=suan;
b[0]=suan;}
else{for(n=15;n>7;n--)
{b[n]=b[n-8];
b[n-8]=0;}
fuhao=suan;
b[0]=suan;}
if(flagdeng==1)
{for(i=8;i<15;i++)
{b[i]=0x10;}flagdeng=0;flagb80=1;
}}

/*处理小数点输入的函数*/
void dian1(uchar di)
{uchar n;
flagshu=1;
if(flagd==0)
{flagd=1;
if(flagy)
{if(b[0]==10||b[0]==12||b[0]==13||b[0]==11&&flagjian==1)
{for(i=0;i<8;i++)
{b[i+8]=b[i];}
b[0]=0;
y[0]=0;}
if(b[0]==11&&flagjian==0)
{if(y[6]==0)
{b[1]=0;
b[0]=15;
b[2]=11;
y[1]=0;
y[0]=15;
v=0;}}
else{if(y[6]==0)
{for(n=6;n>0;n--)
{y[n]=y[n-1];
b[n]=b[n-1];}
v=0;
b[0]=di;
y[0]=di;}}}      
else
{if(x[6]==0)
{if(flagdeng!=0)
{flagdeng=0;
for(n=0;n<8;n++)
{x[n]=0;
b[n]=0;}}
for(n=6;n>0;n--)
{x[n]=x[n-1];
b[n]=b[n-1];}
v=0;
b[0]=di;
x[0]=di;}}}flagb8=0;flagfhshu=0;flagb80=0;}
/*处理读按键的函数*/
void Tkey(void)
{unsigned char readkey;   
unsigned char temp0,temp1;
P1=0Xff;
delay(5);
P1=0xf0;
delay(5);
temp0=P1;
temp0=temp0&0xf0;
if(temp0!=0xf0)
{delay(0xff); delay(0xff);delay(0xff);delay(0xff); delay(0xff);delay(0xff);delay(0xff);delay(0xff);delay(0xff);delay(0xff);delay(0xff);delay(0xff);delay(0xff);
if(temp0!=0xf0)
{P1=0Xff;
delay(5);
   P1=0x0f;
   delay(6);
   temp1=P1;
   temp1=temp1&0x0f;
   readkey=temp0|temp1;}
switch(readkey)        
{
   case 0x77:yun(10); break;
   case 0x7b:yun(11); break;
   case 0x7d:yun(12); break;
   case 0x7e:yun(13); break;
   case 0xb7:dengdengyi(); break;
   case 0xbb:shuzi(3); break;
   case 0xbd:shuzi(6); break;
   case 0xbe:shuzi(9); break;
   case 0xd7:shuzi(0); break;
   case 0xdb:shuzi(2); break;
   case 0xdd:shuzi(5); break;
   case 0xde:shuzi(8); break;
   case 0xe7:dian1(15); break;
   case 0xeb:shuzi(1); break;
   case 0xed:shuzi(4); break;
   case 0xee:shuzi(7); break;
   case 0xe3:clear(); break;}}}
/*主函数*/
void main()
{lcd_init();
huanyingjiemian();
while(1)
{
Tkey();
lcd_init();   
dispall();
}}

[img][img][/img]C:\Users\Administrator\Desktop[/img]

程序好长哦,需要时间

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top