No.41234 作者:stdzm 邮件:stdzm@tom.com ID:13676 登陆:2次 文章数:3篇 最后登陆IP:203.207.68.50 最后登陆:2004/6/14 11:23:57 注册:2003/7/17 8:23:01 财富:113 发帖时间:2003/9/1 17:29:47 发贴者IP:202.117.29.59 标题:stdzm:大家来看看这个lcd液晶显示程序 摘要:No.41234大家来看看这个lcd液晶显示程序 大家看看这个lcd 液晶显示的程序 一下是我的lcd 液晶显示的程序,总是有两个错误,望大家给检查一下,程序比较长望大家耐心看,谢谢 其中的错误是:lcd.c(11):error c129:missing';' before'code' lcd.c(191):error c300: unterminated comment #include <reg51.h> #include <absacc.h> #include <intrins.h> /******LCD****************/ #define LCD_Data_port p1 #define LINE1_ADDR 0x00 #define LINE2_ADDR 0x40 #define LINE3_ADDR 0x10 #define LINE4_ADDR 0x50 /*LCD display table: table_1[]:0~9*/ uchar code Table_1[10]={0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39}; uchar code table_2[10]={0x50,0x4c,0x45,0x53,0x45,0x20,0x57,0x41,0x54,0x45}; static void LCD_goxy(uchar x, uchar y);//LCD static void LCD_string(uchar *s);//write a string to LCD static void LCD_clr(void);//clear display static void LCD_CMD_Write(uchar pass_value);//write command static void LCD_DAT_Write(uchar pass_value);//Write data static void LCD_putbyte(uchar c);//Write a char to LCD static void LCD_RAM_Read(void); static void LCD_DAT_Read(void); void LCD_init(void);//initialize LCD sbit LCD_RS=p3^0; sbit LCD_RW=P3^1; sbit LCD_E=p3^5; /*The main function*/ void main(void) { int k; uchar n; LCD_init(); LCD_clr(); for(n=0;n <10;n++) { LCD_DAT_Write(table_2[k++]); } } /*************************************************** LCD Function ****************************************************/ /*Locate the coordinate*/ static void LCD_goxy(uchar x, uchar y) { uchar tmp; tmp=x&0xf; switch(y) { case 1: tmp|=LINE1_ADDR; case 2: tmp|=LINE2_ADDR; case 3: tmp|=LINE3_ADDR; case 4: tmp|=LINE4_ADDR; break; } LCD_CMD_Write(tmp) } /*Write ......
>>返回讨论的主题
|