欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標(biāo)題:
一個(gè)12864液晶屏的簡(jiǎn)單小程序
[打印本頁]
作者:
oldspring
時(shí)間:
2018-10-21 19:52
標(biāo)題:
一個(gè)12864液晶屏的簡(jiǎn)單小程序
12864液晶屏 (Graphic Lcd 128x64)通常使用三星 KS108/KS107(Samsung KS108/KS107 controller),現(xiàn)在新產(chǎn)品層出不窮,但是他們驅(qū)動(dòng)模塊的功能都是大同小異。相互可以兼容。
以下是一個(gè)簡(jiǎn)單的小程序,希望大家能夠喜歡。
//Declarations------------------------------------------------------------------
const code char truck_bmp[1024];
//--------------------------------------------------------------end-declarations
// Glcd module connections
char GLCD_DataPort at P0;
sbit GLCD_CS1 at P2_0_bit;
sbit GLCD_CS2 at P2_1_bit;
sbit GLCD_RS at P2_2_bit;
sbit GLCD_RW at P2_3_bit;
sbit GLCD_EN at P2_4_bit;
sbit GLCD_RST at P2_5_bit;
// End Glcd module connections
void delay2S(){ // 2 seconds delay function
Delay_ms(2000);
}
void main() {
unsigned short ii;
char *someText;
#define COMPLETE_EXAMPLE // comment this line to make simpler/smaller example
Glcd_Init(); // Initialize GLCD
Glcd_Fill(0x00); // Clear GLCD
while(1) {
#ifdef COMPLETE_EXAMPLE
Glcd_Image(truck_bmp); // Draw image
delay2S(); delay2S();
#endif
Glcd_Fill(0x00); // Clear GLCD
Glcd_Box(62,40,124,56,1); // Draw box
Glcd_Rectangle(5,5,84,35,1); // Draw rectangle
Glcd_Line(0, 0, 127, 63, 1); // Draw line
delay2S();
for(ii = 5; ii < 60; ii+=5 ) { // Draw horizontal and vertical lines
Delay_ms(250);
Glcd_V_Line(2, 54, ii, 1);
Glcd_H_Line(2, 120, ii, 1);
}
delay2S();
Glcd_Fill(0x00); // Clear GLCD
#ifdef COMPLETE_EXAMPLE
Glcd_Set_Font(Character8x7, 8, 7, 32);// Choose font, see __Lib_GLCDFonts.c in Uses folder
Glcd_Write_Text("mikroE", 1, 7, 2); // Write string
for (ii = 1; ii <= 10; ii++) // Draw circles
Glcd_Circle(63,32, 3*ii, 1);
delay2S();
Glcd_Box(12,20, 70,57, 2); // Draw box
delay2S();
Glcd_Fill(0xFF); // Fill GLCD
Glcd_Set_Font(Character8x7, 8, 7, 32);// Change font
someText = "8x7 Font";
Glcd_Write_Text(someText, 5, 0, 2); // Write string
delay2S();
Glcd_Set_Font(System3x5, 3, 5, 32); // Change font
someText = "3X5 CAPITALS ONLY";
Glcd_Write_Text(someText, 60, 2, 2); // Write string
delay2S();
Glcd_Set_Font(font5x7, 5, 7, 32); // Change font
someText = "5x7 Font";
Glcd_Write_Text(someText, 5, 4, 2); // Write string
delay2S();
Glcd_Set_Font(FontSystem5x7_v2, 5, 7, 32); // Change font
someText = "5x7 Font (v2)";
Glcd_Write_Text(someText, 5, 6, 2); // Write string
delay2S();
#endif
}
}
復(fù)制代碼
相關(guān)信息:
http://www.raoushi.com/bbs/dpj-136722-1.html
GLCD12864.jpg
(79.48 KB, 下載次數(shù): 21)
下載附件
2018-10-21 19:51 上傳
作者:
LBH18
時(shí)間:
2019-3-4 09:06
顯示不了
歡迎光臨 (http://www.raoushi.com/bbs/)
Powered by Discuz! X3.1