📄 tst1.cpp
字号:
/*//////////////////////////////////////////////////////////////////////////
Orgnization: Emtronix Incorporated
Filename: TST1.CPP
Compiler: BC3.1
Authors: CS & ZhangHonglin
Date: April, 2002
Revised: ...
Description: This is a test routine for DOT_LCD
///////////////////////////////////////////////////////////////////////////*/
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <math.h>
#include "lcd_api.h"
void main()
{
int x, y;
struct time t;
clrscr();
printf( "\nDOT LCD Demo\n" );
// goto graghic mode
// initialize graphics mode
LCD_Init( "mlib.chr", "ascii.chr" );
//LCD_SetMode( 1 ); // set to XOR mode
// show chinese char at center position
char BufStr[20];
strcpy( BufStr, "** 欢迎测试 **" );
//strcpy( BufStr, "** 12345678**" );
x = (240-strlen(BufStr)*8)/2;
y = 24;
LCD_WriteString( x, y, BufStr, 1 );
//_Writestring( x, y, BufStr, LCD_BACK, LCD_DOT );
strcpy( BufStr, "嵌入式网络模块" );
x = (240-strlen(BufStr)*8)/2;
y = 48;
LCD_WriteString( x, y, BufStr, 0 );
// draw lines
LCD_DrawLine( 0, 92, 239, 92, 1 );
LCD_DrawLine( 0, 113, 239, 113, 1 );
// draw curve
for( x=0; x<239; x++ )
{
y = 103 - 10.0*sin( 2.0*M_PI*x/24.0 );
LCD_PutPixel( x, y, 1 );
}
for( x=0; x<239; x++ )
{
y = 103 - 10.0*sin( 2.0*M_PI*x/24.0 );
LCD_PutPixel( x, y, 0 );
}
LCD_FillBar( 0, 92, 239, 113, 0 );
LCD_FillBar( 0, 92, 239, 113, 1 );
LCD_FillBar( 0, 92, 239, 113, 0 );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -