维修网

 找回密码
 注册

QQ登录

只需一步,快速开始

微信扫码 , 快速开始

查看: 158|回复: 3

我编的12864的程序试验通过但是有点问题

[复制链接]

该用户从未签到

发表于 2010-1-19 21:10:40 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?注册

x
# define ps_s#include <12864.H>#include <INTRINS.H>#include <ad.H>#include <ds18b20.H>
" {* a4 V4 h! a3 V9 Oextern void LCD_RES();extern void wri(uchar);extern void wrd(uchar);extern void DELAY1MS(uchar);extern void DELAY100US(uchar);$ p: [6 ~# w+ J0 M: [. f& |
typedef unsigned char uchar;typedef unsigned int uint;
8 E3 c5 t+ E& E" X  H2 I0 Ocode unsigned char pic[]={0xd3,0xc0,0xbb,0xd4,0xbb,0xfa,0xb5,0xe7,0xbb,0xb0,0xc2,0xa9,//0xb9,0xca,0xc8,0xcb,0xce,0xf7,0xb4,0xc7,0xbb,0xc6,0xba,0xd7,0xc2,0xa5,0xa3,0xac,0xb9,0xc2,0xb7,0xab,0xd4,0xd6,0xd3,0xb0,0xb1,0xcc,0xbf,0xd5,0xbe,0xa1,0xa3,0xac,0xd1,0xcc,0xbb,0xa8,0xc8,0xfd,0xd4,0xc2,0xcf,0xc2,0xd1,0xef,0xd6,0xdd,0xa1,0xa3,0xce,0xa8,0xbc,0xfb,0xb3,0xa4,0xbd,0xab,0xcc,0xec,0xbc,0xca,0xc1,0xf7,0xa1,0xa3};code unsigned char pic2[]={0xb9,0xf9,0xb3,0xac,0xb5,0xc4,0xb5,0xe7,0xbb,0xb0};/*-- 调入了一幅图像:C:\Documents and Settings\Administrator\桌面\tubiao.bmp --*//*-- 宽度x高度=128x64 --*//*0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFE,0x00,0x00,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xC0,0x00,0x00,0x0F,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0x00,0x00,0x00,0x03,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF8,0x00,0x00,0x00,0x00,0x7F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xE0,0x00,0x00,0x00,0x00,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x80,0x00,0x00,0x00,0x00,0x07,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x7C,0xF9,0xE1,0xE0,0x03,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x38,0x30,0xC0,0xC0,0x01,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x00,0x38,0x60,0xC0,0xC0,0x00,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x1C,0x60,0xC0,0xC0,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF8,0x00,0x1C,0x60,0xC0,0xC0,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF0,0x00,0x1C,0xC0,0xC0,0xC0,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF0,0x00,0x0E,0xC0,0xC0,0xC0,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF0,0x00,0x0E,0xC0,0xC0,0xC0,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF0,0x00,0x07,0x80,0xFF,0xC0,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF0,0x00,0x07,0x80,0xC0,0xC0,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF0,0x00,0x07,0x00,0xC0,0xC0,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF0,0x00,0x03,0x00,0xC0,0xC0,0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF8,0x00,0x03,0x00,0xC0,0xC0,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x00,0x03,0x00,0xC0,0xC0,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFC,0x00,0x03,0x00,0xC0,0xC0,0x00,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x03,0x00,0xC0,0xC0,0x01,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x00,0x03,0x80,0xC0,0xC0,0x03,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x80,0x0F,0xC1,0xE1,0xE0,0x07,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xE0,0x00,0x00,0x00,0x00,0x1F,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF8,0x00,0x00,0x00,0x00,0x7F,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0x00,0x00,0x00,0x03,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xC0,0x00,0x00,0x0F,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFE,0x00,0x00,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,

手机扫码浏览

该用户从未签到

 楼主| 发表于 2010-1-19 21:10:41 | 显示全部楼层
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00*/: E" |2 Y  g$ y$ N. n; B
/*0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,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,0x00,0x00,0x00,0x00,0x01,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,0x00,0x00,0x00,0x00,0x01,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,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0xE0,0x00,0xC0,0xE0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x07,0xDE,0x00,0x00,0x78,0x00,0x00,0x00,0x38,0x01,0xF1,0xF0,0x00,0x00,0xF8,0x00,0xF0,0xF0,0x00,0x07,0xBC,0x00,0xE0,0x01,0xE0,0x03,0x9E,0x00,0x00,0x00,0x71,0x80,0x07,0xDE,0x00,0x00,0x3C,0x00,0x0F,0xFF,0xFC,0x00,0x79,0xE0,0x00,0x0F,0xF7,0x80,0xE0,0xF0,0x00,0xF7,0x9F,0x00,0xFF,0xFF,0xE0,0x03,0xDE,0x00,0x3F,0xFF,0xF9,0x80,0x07,0x9E,0x00,0x00,0x3C,0x1C,0x0F,0x1E,0x78,0x00,0x7B,0xCE,0x00,0xFF,0xF7,0x8E,0xE0,0xF7,0x80,0xF7,0x8F,0x00,0xF0,0x01,0xE0,0x07,0xFE,0x00,0x00,0x00,0x79,0x80*///};//num显示位置,n显示汉字个数*2,ccode显示代码
3 j; X& L6 O0 O& b7 jvoid disp_ch(unsigned char num,unsigned char n,unsigned char ccode){ //char count=64; wri(num); while(n--) { wrd(*(pic+ccode)); ccode++; }}8 f( ]! S) m1 k, A( H7 b1 i
void disp_pic2(uchar *p){ uchar x=0; uchar y=0; wri(0x34);//扩充功能设定,扩充指令集动作 wri(0x36);//扩充功能设定,绘图显示ON for(y=0;y<32;y++) { wri(0x80+y);//设定绘图RAM地址/ wri(0x80+x); for(x=0;x<32;x++) { wrd(*p); p++; } x=0; }
0 b0 z: q* N, P5 L/ K# J: w}
/ t$ n3 K1 w- dvoid pingxsh0()//显示首页{ //disp_ch(0x82,4,2); disp_ch(0x82,8,0);// //DELAY1MS(250); //DELAY1MS(250); disp_ch(0x98,4,6);//显示汉字电话 wri(0x9a); wrd(0x3a);//字符:03178919067 wrd(0x30); wrd(0x33); wrd(0x31); wrd(0x37); wrd(0x38); wrd(0x39); wrd(0x31); wrd(0x39); wrd(0x30); wrd(0x36); wrd(0x37);}void pingxsh1()//显示主屏{ wri(0x80);wrd(0x49);wrd(0x44);wrd(0x3a);wrd(0x31);wrd(0x37);//ID:17 wri(0x84);wrd(0x54);wrd(0x3a);wrd(0x30+wh);wrd(0x30+wl);//T: wri(0x90);wrd(0x41);wri(0x92);wrd(0x42);wri(0x94);wrd(0x43);//A B C disp_ch(0x96,2,10);//显示汉字漏 wri(0x88);wrd(0x30+a1);//wrd(0x2e);wrd(0x30+a3);wrd(0x30+a4);//电流值0 0 0 0 wri(0x8a);wrd(0x30);wri(0x8c);wrd(0x30);wri(0x8e);wrd(0x30); wri(0x98);wrd(0x30);wrd(0x38);wrd(0x2d);wrd(0x31);wrd(0x34);//日期 wri(0x9c);wrd(0x30);wrd(0x39);wrd(0x3a);wrd(0x35);wrd(0x35);wrd(0x3a);wrd(0x34);wrd(0x37);//时间 }void pingxsh2()//功能{ wri(0x80);wrd(0xb9);wrd(0xf9);wrd(0xb3);wrd(0xac);wrd(0xb5);wrd(0xc4);wrd(0xb5);wrd(0xe7);wrd(0xbb);wrd(0xb0); disp_ch(0x98,4,6);wri(0x9a);wrd(0x31);wrd(0x35);wrd(0x30);wrd(0x33);wrd(0x31);wrd(0x34);wrd(0x32);wrd(0x37);wrd(0x30);wrd(0x31);wrd(0x36);}0 p- ^; I. s& D* b* ?1 c( K7 Q6 Z
//************滤波void lvbo(void){ cishu++; sum=sum+jieguo; if (cishu==10) { //result=sum/10; cishu=0; //sum=0; shici=1; } }
2 Q; i+ Y, Y6 ]; u  W! V9 U//*********标度变换void change(void){ //value=sum*6*10/1024; value=sum*5; value=value*10; value=value/1024;8 e7 w- ?! O4 [, u; l& l
}! j: @# b$ N2 ^7 Q1 r0 o* ^3 I7 L7 y
void same_data(uchar d){ uchar x=0; uchar y=0;
3 q# V# \$ A. U0 d, h3 j* r for(y=0;y<32;y++) { wri(0x80+y); wri(0x80+x); for(x=0;x<32;x++) { wrd(d); } x=0; }}
  E' b* K* \# o6 ^void main(){ uchar w1,w2; # ifdef ps_p PSB=1; #else PSB=0; #endif a1=0x00; a2=0x00; a3=0x00; a4=0x00; LCD_RES(); DELAY1MS(250); DELAY1MS(250); pingxsh0();//显示首页 DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); wri(0x01);//
9 f6 S- K: e4 O1 [6 U DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250);//清显示gxsh1();//显示主屏/*DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250);*/pingxsh1();//显示主屏 DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250);wri(0x01);//清显示8 M1 D% E4 G/ h4 J9 G  [! h
DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); DELAY1MS(250); pingxsh2(); while(1) { //采集电压 ADC_Power_On();//AD上电 Set_P10_Open_Drain(); ADC_Power_On();//AD上电 Set_ADC_Channel_0(); ADC_Power_On();//AD上电 Get_AD_Result();// lvbo();//滤波 if (shici==1) { shici=0;

该用户从未签到

 楼主| 发表于 2010-1-19 21:10:41 | 显示全部楼层
change();//标度变换 sum=0; a1=value/100; a2=value%100; a3=a2/10; a4=a2%10;, G( f, `8 ?' R1 J
} //pingxsh1();//显示主屏 //温度处理 tmstart(); //DELAY1MS(250);DELAY1MS(250);DELAY1MS(250);DELAY1MS(250);DELAY1MS(250);DELAY1MS(250); tmrtemp () ;//读温 //DELAY1MS(250);DELAY1MS(250);DELAY1MS(250);DELAY1MS(250);DELAY1MS(250);DELAY1MS(250); w1=wen_du_h<<4; w2=wen_du_l>>4; wen_du=w1|w2; wh=wen_du/10; wl=wen_du%10; //; /* //wr_cgram1(); DELAY1MS(250); DELAY1MS(250); wr_cgram2(); DELAY1MS(250); DELAY1MS(250); wr_cgram3(); DELAY1MS(250); DELAY1MS(250); wr_cgram4();*/ //DELAY1MS(250); //DELAY1MS(250); //DELAY1MS(250); //DELAY1MS(250); //LCD_RES(); /*for(p=0;p<32;p++)//显示啊,字库B0A1 { wrd(0xb0); wrd(0xa1); }*/ //DELAY1MS(250); //DELAY1MS(250);9 k' I: u. o& b  j$ D
/*wri(0x01); wri(0x34); wri(0x36); //same_data(0x00); DELAY1MS(250); DELAY1MS(250); disp_pic2(pic2); DELAY1MS(250); DELAY1MS(250);*/
) _# L8 ]) T. z6 y }}
1 G7 @2 R- y2 `4 p2 z8 P- ? 我要清屏两次才能显示首页 我不知道为生命清屏后还要延时

该用户从未签到

发表于 2010-1-19 21:10:42 | 显示全部楼层
嗯 问题很大:坐沙发上都看不懂
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新贴|维修网 ( 粤ICP备09047344号

GMT+8, 2024-11-1 07:00 , Processed in 0.260628 second(s), 30 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表