英锐恩单片机论坛,Microchip单片机,模拟器件,接口电路,麦肯单片机,单片机应用交流

 找回密码
 立即注册
搜索
电子烟方案单片机单片机开发深圳单片机开发
单片机方案国产单片机8位单片机电子烟方案开发
查看: 4259|回复: 0
打印 上一主题 下一主题

c语言写的液晶显示

[复制链接]
跳转到指定楼层
1#
发表于 2009-4-15 10:32:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Code for a varitron 128 x 64 LCD display which use a T6363 LCD controller (by Jan van Gelder).

/**************************************************************************************************  File name : lcd_examples*  Discription : examples how to make use of the LCD functions in lcd873.c ******************************************************************************************************/#include "Lcd873.c"void main(void);////////////////////////////////////////////////////////////////////////////////////////////////////          TEST ROUTINE'S  to test LCD  code                                                   ////////////////////////////////////////////////////////////////////////////////////////////////////void main(void){ char i; char j; const char *text =  "Graphic LCD       128 x 64         T6963C    "; const char *text3 = "Signal meter"; const char *text4 = "Spektrum Monitor"; const char *text5 = "TEXT BOX"; LCDPortIOInit(PortAConfig,PortBConfig,PortCConfig); LCDIniSet(); LCDClearTextRAM(); LCDClearGraphicRAM(); AGAIN: // example how to write a predefined string to display LCDSetAdresPointer(LINE1_PAGE1T); for(i = 0; text[i] != 0 ;i++)  {   LCDputchar(text[i]);  } delay_s(2); // let text blinks on display LCDBlinkingText(1600,20,1); // example how to clear text page1 LCDClearTextPage(1); // write string  "Signal meter" to display LCDSetAdresPointer(LINE3_PAGE1T); for(i = 0; text3[i] != 0 ;i++) {   LCDputchar(text3[i]); } // example of a signalmeter with  diferent value's    for( i = 0 ; i < 250; i ++) {  LCDDrawSignalMeter(LINE3_PAGE1G + 4 ,1,i);  i ++; } for( i = 250 ; i > 3; i --) {  LCDDrawSignalMeter(LINE2_PAGE1G + 4,1,i);  i --; } // example of how to draw a spektrum display with vertical bars // clear all text ram LCDClearTextRAM(); LCDSetAdresPointer(LINE2_PAGE1G); LCDDrawHorLine(SOLID,16); LCDSetAdresPointer(LINE6_PAGE1G); LCDDrawHorLine(DOTS1,16); LCDSetAdresPointer(LINE10_PAGE1G); LCDDrawHorLine(DASH1,16); LCDSetAdresPointer(LINE14_PAGE1G); LCDDrawHorLine(DOTS2,16); LCDSetAdresPointer(LINE18_PAGE1G); LCDDrawHorLine(DASH,16); delay_s(2); // set adres pointer where to  write the  string  Spektrum Monitor LCDSetAdresPointer(LINE8_PAGE1T); for(i = 0; text4[i] != 0 ;i++)  {   LCDputchar(text4[i]);  } // example which draws bars with differend values j = 2; for( i = 0; i < 128 ;i++) {  LCDDrawVerticalBar(LINE1_PAGE1G,i,j);  j = j + 2; } delay_s(2); LCDClearGraphicRAM(); LCDDrawVerticalBar(LINE1_PAGE1G,64,32); LCDDrawVerticalBar(LINE1_PAGE1G,65,48); LCDDrawVerticalBar(LINE1_PAGE1G,66,32); delay_s(1); LCDDrawVerticalBar(LINE1_PAGE1G,100,64); LCDDrawVerticalBar(LINE1_PAGE1G,101,128); LCDDrawVerticalBar(LINE1_PAGE1G,102,64); delay_s(1); LCDDrawVerticalBar(LINE1_PAGE1G,10,100); LCDDrawVerticalBar(LINE1_PAGE1G,11,200); LCDDrawVerticalBar(LINE1_PAGE1G,12,100); delay_s(1); LCDDrawVerticalBar(LINE1_PAGE1G,64,200); LCDDrawVerticalBar(LINE1_PAGE1G,65,250); LCDDrawVerticalBar(LINE1_PAGE1G,66,200); delay_s(1); LCDDrawVerticalBar(LINE1_PAGE1G,64,32); LCDDrawVerticalBar(LINE1_PAGE1G,65,48); LCDDrawVerticalBar(LINE1_PAGE1G,66,32); delay_s(2); LCDBlinkingText(800,20,1); delay_s(4); LCDClearGraphicRAM(); LCDClearTextRAM(); LCDDrawTextBox(LINE14_PAGE1G + 1,10,12); LCDSetAdresPointer(LINE3_PAGE1T+2); for(i = 0; text5[i] != 0 ;i++)  {   LCDputchar(text5[i]);  } delay_s(2); LCDBlinkingText(900,10,1); LCDClearGraphicRAM(); LCDClearTextRAM(); LCDDrawSquare(LINE32_PAGE1G + 2,8,32); delay_ms(500); LCDDrawSquare(LINE4_PAGE1G + 5,4,16); delay_ms(500); LCDDrawSquare(LINE8_PAGE1G + 8,8,32); delay_s(1); LCDClearGraphicRAM(); LCDClearTextRAM(); goto AGAIN;}
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|公司首页|Microchip单片机,模拟器件,接口电路,麦肯单片机,单片机应用交流 ( 粤ICP备09008620号 )

GMT+8, 2024-11-24 03:40 , Processed in 0.052991 second(s), 23 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表