久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费
標題:
高人求解
[打印本頁]
作者:
秋之落葉
時間:
2012-3-28 10:48
標題:
高人求解
#include"reg52.h" #include"string.h" unsigned char table[]={0x00,0x00,0x00,0x3C,0x12,0x11,0x11,0x11,0x11,0x11,0x12,0x3C,0x00,0x00,0x19,0x19,0x06,0x06,0x19,0x19,0x06,0x00,0x06,0x19,0x19,0x06,0x06,0x19,0x19,0x00,0x89,0x89,0x06,0x06,0x89,0x89,0x06,0x00,0x06,0x89,0x89,0x06,0x06,0x89,0x89,0x00}; #define CLEARSCREEN LCD_write_command(0x01) #define LCDIO P0 sbit LCD1602_RS=P2^0; sbit LCD1602_RW=P2^1; sbit LCD1602_EN=P2^2; sbit Key1=P2^3; sbit Key2=P2^4; sbit Key3=P2^5; sbit Key4=P2^6; sbit Key5=P2^7; void LCD_write_command(unsigned char command);//寫入指令函數 void LCD_write_dat(unsigned char dat);//寫入數據函數 void LCD_set_xy( unsigned char x, unsigned char y );//設置顯示位置函數 void LCD_dsp_char( unsigned x,unsigned char y,unsigned char dat);//顯示一個字符函數 void LCD_dsp_string(unsigned char X,unsigned char Y,unsigned char *s);//顯示字符串函數 void LCD_init(void);//初始化函數 void delay_nms(unsigned int n); void Write_CGRAM(unsigned char *p) { unsigned char i,j,kk; unsigned char tmp=0x40; //操作CGRAM的命令碼 kk=0; for(j=0;j<8;j++) //64 字節存儲空間,可以生成 8="8" 個自定義字符點陣 { for(i=0;i<8;i++) // 8="8" 個字節生成 1="1" 個字符點陣 { LCD_write_command(tmp+i); //操作CGRAM的命令碼+寫入CGRAM地址. LCD_write_dat(p[kk]); //寫入數據 kk++; } tmp="tmp" += 8; } } void LCD_init(void) { CLEARSCREEN;//clear screen="screen" LCD_write_command(0x38);//set 8="8" bit="bit" data="data" transmission="transmission" mode="mode" LCD_write_command(0x0c);//open display="display" (enable lcd="lcd" display) LCD_write_command(0x80);//set lcd="lcd" first="first" display="display" address="address" CLEARSCREEN;//clear screen } void LCD_write_command(unsigned char="char" command) { lcdio="command; " lcd1602_rs="0;" lcd1602_rw="0; " lcd1602_en="0; " delay_nms(10); lcd1602_en="1; " delay_nms(10); } void LCD_write_dat(unsigned char="char" dat) { LCDIO=dat; LCD1602_RS=1; LCD1602_RW=0; LCD1602_EN=0; delay_nms(10); LCD1602_EN=1; } void LCD_set_xy( unsigned="unsigned" char="char" x, unsigned="unsigned" char="char" y="y" ) { unsigned char="char" address; if (y == 1) { address="address" = 0x80="0x80" + x;} else { address="address" =0xc0+ x;} LCD_write_command(address); } /****************顯示一個字符**********************/ void LCD_dsp_char( unsigned="unsigned" x,unsigned char="char" y,unsigned char="char" dat) { LCD_set_xy( x, y="y" ); LCD_write_dat(dat); } /***************顯示字符串函數***************/ void LCD_dsp_string(unsigned char="char" X,unsigned char="char" Y,unsigned char="char" *s) { LCD_set_xy( X, Y="Y" ); while="while" (*s) { LCD_write_dat(*s); s="s" ++; } } /***********************************************/ void delay_nms(unsigned int="int" n) { unsigned="unsigned" int="int" i="0,j=0; " for="for" (i=n;i>0;i--) for (j=0;j<10;j++); } void main(void) { int i,aa,bb; delay_nms(5000); LCD_init(); delay_nms(100); Write_CGRAM(table); Key1=0; Key2=0; Key3=0; Key4=0; Key5=0; lable:while(1){ LCD_dsp_string(0,1," welcome ");//顯示歡迎界面 LCD_dsp_string(0,2," 2011.05.25 "); if(Key1==1||Key2==1||Key3==1||Key4==1||Key5==1){ CLEARSCREEN; while(1){ if(Key1==1){ //顯示大寫D. CLEARSCREEN; for (i=0;i<1;i++) { LCD_dsp_char( 8+i,1,i); delay_nms(1); } for (i=1;i<2;i++) { LCD_dsp_char( 8+i-1,2,i); delay_nms(1); } aa="0;bb=0; " while(1){ aa++; if(aa==10000) bb++; if(bb==10)goto lable; if(Key1==1||Key2==1||Key3==1||Key4==1||Key5==1) { break; } }} if (Key2==1){ CLEARSCREEN; LCD_dsp_string(0,1," D ");delay_nms(100); //顯示小寫D aa="0;bb=0; " while(1){ aa++; if(aa==10000)bb++;if(bb==10)goto lable; if(Key1==1||Key2==1||Key3==1||Key4==1||Key5==1) { break; } }} if (Key3==1){ CLEARSCREEN; LCD_dsp_char( 8,1,2);//顯示自己設計好的圖案。 LCD_dsp_char( 9,1,4); LCD_dsp_char( 8,2,3); LCD_dsp_char( 9,2,5); delay_nms(100); aa="0;bb=0; " while(1){ aa++; if(aa==10000)bb++;if(bb==10)goto lable; if(Key1==1||Key2==1||Key3==1||Key4==1||Key5==1) { break; } } } if (Key4==1){ CLEARSCREEN; LCD_dsp_string(0,1," smile ") ;//顯示微笑 LCD_dsp_string(0,2," (^-^) "); delay_nms(100); aa="0;bb=0; " while(1){ aa++; if(aa==10000) bb++; if(bb==10)goto lable; if(Key1==1||Key2==1||Key3==1||Key4==1||Key5==1) { break; } }} if (Key5==1){ CLEARSCREEN; LCD_dsp_string(0,1," thankyou byebye ");//顯示thankyou byebye. LCD_dsp_string(0,2," 2011.05.25 "); delay_nms(100); aa="0;bb=0; " while(1){ aa++; if(aa==10000) bb++; if(bb==10)goto lable; if(Key1==1||Key2==1||Key3==1||Key4==1||Key5==1) { break; } }} } } } } 為什么下載到單片機里面只有第一行全滿,求指教。
作者:
xuqinghua
時間:
2012-3-28 12:21
看著頭好暈
作者:
dongfangxiao
時間:
2012-3-30 21:56
整理整理再發嗎
作者:
yangfuq
時間:
2012-5-25 22:27
太復雜了,我
歡迎光臨 (http://www.zg4o1577.cn/bbs/)
Powered by Discuz! X3.1
主站蜘蛛池模板:
天天色综
|
精品国产91亚洲一区二区三区www
|
欧美午夜一区
|
中文字幕一区二区在线观看
|
色婷婷一区二区三区四区
|
精品久久久一区
|
亚洲性人人天天夜夜摸
|
日日夜夜天天综合
|
成人午夜在线
|
久久久久1
|
成人毛片在线观看
|
久在线
|
久久精品国产一区二区三区不卡
|
99精品观看
|
日本成人中文字幕在线观看
|
日韩视频精品在线
|
国产小u女发育末成年
|
www.天天干.com
|
a国产一区二区免费入口
|
国产无人区一区二区三区
|
亚洲精品视频在线播放
|
日韩视频国产
|
在线一区二区观看
|
午夜视频精品
|
日韩中文字幕久久
|
国产成人一区二区三区久久久
|
精品欧美一区二区三区久久久
|
成人欧美一区二区三区在线观看
|
国产探花在线精品一区二区
|
久久精品国产一区二区电影
|
在线黄
|
91久久综合
|
色男人的天堂
|
国产一区在线免费
|
国产精品视频在线观看
|
欧美日韩一区二区在线播放
|
天天艹日日干
|
亚洲精品乱码久久久久久黑人
|
国产亚洲精品91
|
精品一区二区三区四区在线
|
亚洲精品一区二区三区中文字幕
|