各位大大,小弟也是8051的新手。目前照著書本練習LCD的專案。LCD專案最後有幾個習題讓人練習。我現在卡在說要如何做成字幕機讓字體往左移動(或是往右移動)。請各位大大指教。#include#defineRSP3_2//LCDPin4#defineRWP3_1//LCDPin5#defineEP3_0//LCDPin6codecharstring1[]={"Hello!"};codecharstring2[]={"ThisisTim!"};voiddelay_10us(unsignedinttime){while(time>0)time--;}voidwrite_c(charlcd_data){RS=0;RW=0;E=1;P0=lcd_data;delay_10us(100);E=0;delay_10us(100);}voidwrite_d(charlcd_data){RS=1;RW=0;E=1;P0=lcd_data;delay_10us(100);E=0;delay_10us(100);}voidinit(void){delay_10us(2000);//delay20mswrite_c(0x30);//functionsetupwrite_c(0x30);//functionsetupwrite_c(0x38);//functionsetupwrite_c(0x08);//DISPLAYOFFwrite_c(0x01);//DISPLAYCLEARwrite_c(0x06);//INPUTMODESETUPwrite_c(0x0f);//DISPLAYON}voiddisp_p(charrow,word){charchange_p;row--;word--;change_p=0x80 (row*0x40 word);write_c(change_p);}voiddisp_s(char*ptr){while(*ptr!=0){write_d(*ptr);ptr ;}}voidmain(void){inti;init();disp_p(1,1);disp_s(string1);disp_p(2,1);disp_s(string2);while(1);}