12864不亮怎么回事
#include<avr/io.h>#include <macros.h>
#define uchar unsigned char
#define uintunsigned int
#define uchar unsigned char
#define uintunsigned int
#define RS_0PORTC &= ~(1 << PC0) //RS为0
#define RS_1PORTC |= (1 << PC0) //RS为1
#define RW_0PORTC &= ~(1 << PC1) //RW为0
#define RW_1PORTC |= (1 << PC1) //RW为1
#define EN_0PORTC &= ~(1 << PC2) //EN为0
#define EN_1PORTC |= (1 << PC2) //EN为1
#define PSB_0PORTC &= ~(1 << PC3) //PSB为0
#define PSB_1PORTC |= (1 << PC3) //PSB为1
//串/并方式控制,高电平为并行方式,低电平为串行方式
#define RST_0PORTC &= ~(1 << PC5) //RST为0
#define RST_1PORTC |= (1 << PC5) //RST为1
uchar Line1_data[]={"wwww"};
uchar Line2_data[]={"wwww"};
uchar Line3_data[]={"wwww"};
uchar Line4_data[]={"wwww"};
void delay_us(unsigned int n)
{
if(n == 0)
return ;
while(--n);
}
void Delay_ms(uint xms)
{
int i,j;
for(i =0;i<xms;i++)
{
for(j=0;j<1140;j++);
}
}
uchar lcd_busy()
{
uchar result;
DDRA = 0x00;
RS_0;
RW_1;
EN_1;
delay_us(40);
result=PIND&0x80;
EN_0;
return result;
}
void lcd_wcmd(uchar cmd)
{
DDRA=0XFF;
RS_0;
RW_0;
EN_0;
PORTA=cmd;
delay_us(40);
EN_1;
delay_us(40);
EN_0;
}
void lcd_wdat(dat)
{
DDRA=0XFF;
RS_1;
RW_0;
EN_0;
PORTA=dat;
delay_us(40);
EN_1;
delay_us(40);
EN_0;
}
void lcd_clr()
{
lcd_wcmd(0x01);
Delay_ms(5);
}
void lcd_init()
{
PSB_1;
RST_0;
Delay_ms(3);
RST_1;
Delay_ms(3);
lcd_wcmd(0x34);
Delay_ms(5);
lcd_wcmd(0x30);
Delay_ms(5);
lcd_wcmd(0x0c);
Delay_ms(5);
lcd_wcmd(0x01);
Delay_ms(5);
}
void LocateXY(uchar x,uchar y)
{
if(y==0){lcd_wcmd(0x80 + x);}
else if(y==1){lcd_wcmd(0x90 + x);}
else if(y==2){lcd_wcmd(0x88 + x);}
else if(y==3){lcd_wcmd(0x98 + x);}
}
void LCD_write_str(uchar x, uchar y,uchar *s)
{
LocateXY(x,y);
while(*s)
{
lcd_wdat(*s);
s++;
}
}
void port_init(void)
{
PORTA = 0XFF;
DDRA = 0XFF;
PORTC=0XFF;
DDRC =0XFF;
}
void main()
{
uchar i;
uchar Line1_data[]={"wwww"};
uchar Line2_data[]={"wwww"};
uchar Line3_data[]={"wwww"};
uchar Line4_data[]={"wwww"};
port_init();
Delay_ms(100);
lcd_init();
while(1)
{
LocateXY(0,0);
for(i=0;i<16;i++)
{
lcd_wdat(Linel_data);
Delay_ms(100);
}
LocateXY(0,1);
for(i=0;i<16;i++)
{
lcd_wdat(Line2_data);
Delay_ms(100);
}
LocateXY(0,2);
for(i=0;i<16;i++)
{
lcd_wdat(Line3_data);
Delay_ms(100);
}
LocateXY(0,3);
for(i=0;i<16;i++)
{
lcd_wdat(Line4_data);
Delay_ms(100);
}
lcd_clr();
}
}
main.c:134: error: 'Linel_data' undeclared (first use in this function)
main.c:134: error: (Each undeclared identifier is reported only once
main.c:134: error: for each function it appears in.)
不知道怎么回事
帮帮忙啊 帮忙啊
自己顶
帮顶{:lol:} Linel_data' undeclared,没定义,line1_data. 电路图在这帮忙看看哪不对吧感谢 QQ截图20130519115441.png 电路有没有问题?? lr120363092 发表于 2013-5-20 09:35 static/image/common/back.gif
电路有没有问题??
木有 程序不知对不
页:
[1]