(数组用一堆字符初始化)
当我使数组更大时,我也会收到一条错误消息“数据段太大”。如何将数组从“CODE”复制到“XDATA”?或者这不是问题吗?
编辑:另外,当我以这种方式调用函数时,lcd 会跳过数组中的元素 [i] [] 并打印下一个元素 [i]。
任何帮助我都会非常感激。
unsigned char piece [4] [8];
lcd_msg_write(piece[0]); //rank
lcd_write(SecondLine);
lcd_msg_write(piece[1]);
lcd_write(SecondLine);
lcd_msg_write(piece[2]);
lcd_write(SecondLine);
lcd_msg_write(piece[3]);
lcd_write(SecondLine);
void lcd_msg_write(char * ptr2)
{
int x;
RS = 1;
for (x=0; x<8;x++)
lcd_write(*ptr2++); //write till end of string reached
RS = 0;
}
void lcd_write(unsigned char display_data)//LCD 1 {
EN = 1;
P0 = display_data;
EN = 0;
delay_5msec(); //delay to allow write operation to complete
}