深圳市川航电子科技有限公司
:常东
:
直线:
传真:
MSN:
:
网址:https://www.chuanhang.com
附页
C语言程序代码:
//================================================================ void LCMCW(void); void RWCheck(void); void DELAY_CLS(void); void delay_ms(uint ms_value); void delay_us(uchar us_value); void wr_data(uchar wrdata); void wr_cmd(uchar cmd); void LCD_CLS(void); void wr_cmd_data( uchar cmd,uchar dat1,uchar dat2); void display(uchar fst, uchar snd);
void init_cpu(void ); void init_lcd(void); void disp_Graphic(); void disp_Q(void ); void LCD_Test(void); void disp_clip(void ); void disp_fangkuang(void ); void snow(uchar fst, uchar snd); void ShowZF(uchar lin,uchar column,uchar *ptString); void Pixel(uchar PointX,uchar PointY, bit Mode);
void disp_Graphic1();
void disp_Graphic2();
void disp_Graphic3();
//================================================================
void main() {
init_cpu(); init_lcd();
while(1) { disp_Graphic1(); DELAY_CLS();
Pixel( 10,10,1); Pixel( 0,0,1); Pixel( 1,1,1); DELAY_CLS(); disp_Graphic2(); DELAY_CLS();
disp_Graphic3(); DELAY_CLS();
disp_Q(); //显示字库 DELAY_CLS();
disp_fangkuang1(); DELAY_CLS(); LCD_Test(); //全黑、全白、竖显 disp_Q(); DELAY_CLS(); //显示字库
// ShowZF(0,0,"WLCOME"); // ShowZF(3,2,"WLCOME TO SHENGZHENG"); // DELAY_CLS(); }
}
//----------------------------------------------------------------
void delay_ms(uint ms_value) //delay about 1 ms { uint k;
for(k=0;k { delay_us(200); } }
//----------------------------------------------------------------
void wr_cmd(uchar cmd) { RWCheck(); lcd_data = 0x00; // Set the port as Output CS=0; CD = 1; RD0 = 1; WR0 = 0; lcd_data =cmd; WR0 = 1; CS = 1; }
//----------------------------------------------------------------
void wr_data(uchar wdata) { RWCheck(); lcd_data = 0x00; // Set the port as Output CS=0; CD = 0; RD0 = 1; WR0 = 0; lcd_data = wdata; WR0 = 1; CS = 1; }
//----------------------------------------------------------------
void wr_cmd_data( uchar cmd,uchar dat1,uchar dat2) { wr_data(dat1); wr_data(dat2); wr_cmd(cmd); }
}
注:以上程序并未*付上,具体子程序请与店主联系,谢谢! |