久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 3888|回復: 3
收起左側

高人求解

[復制鏈接]
ID:37070 發表于 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; } }} } } } } 為什么下載到單片機里面只有第一行全滿,求指教。
回復

使用道具 舉報

ID:35775 發表于 2012-3-28 12:21 | 顯示全部樓層

看著頭好暈

 

回復

使用道具 舉報

ID:37434 發表于 2012-3-30 21:56 | 顯示全部樓層
整理整理再發嗎
回復

使用道具 舉報

ID:32563 發表于 2012-5-25 22:27 | 顯示全部樓層

太復雜了,我

回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 99福利在线观看 | 不卡的av在线 | 天天色影视综合 | 亚洲性视频网站 | 日本一区二区高清不卡 | 国产欧美精品一区二区色综合朱莉 | 男女视频在线观看 | 国产91丝袜 | 成人片免费看 | 九九综合| 久产久精国产品 | 亚洲欧美日韩精品久久亚洲区 | 成人久久18免费 | 国产成人精品久久二区二区91 | 亚洲成人精品 | av中文在线| 欧美久久久网站 | 中国大陆高清aⅴ毛片 | 国产一区二区三区在线免费观看 | 欧美性video 精品亚洲一区二区 | 激情五月婷婷丁香 | 国产成人免费在线 | 91成人在线 | 国产成人精品午夜视频免费 | 久久美女网 | 亚洲最新在线 | 精品99爱视频在线观看 | 亚洲视频一区在线播放 | 日本亚洲一区 | 久久精品国产99国产精品 | 日本午夜一区二区三区 | 超碰导航 | 欧美综合在线观看 | a级网站 | 欧美 视频 | 日本国产一区二区 | 黄色欧美在线 | 国产一级视屏 | 久久亚洲一区二区 | 亚洲最新在线 | 成人在线视频一区二区三区 |