📄 main.c
字号:
/*
*******************************************************************************************************************
* 65k color LCD demo
* Description: Driver development for CM50010ACT6 65k color LCD demo. This program either display bmp file
* in *.h format or display system font pixel-by-pixel with the whole screen displays red, green, & blue
* File: ..\CM50010ACT\main.c
* Software: Keil C (C51) compiler, Eval version 7.09 under uVision2 IDE v2.40
* Programmer: John Leung, TechToys Co. (www.TechToys.com.hk)
* Hardware: AT89S52-gLCD-STK1 PCB, with Atmel AT89C51RB2 running at 3.3V Vdd, 11.0592 MHz crystal
* LCD is CM50010ACT6 module Part # (CM50010ACT6_BO_HDC1600)
* The LCD controller is Hyvix's (www.hyvix.com) HDC1600
* Date: 24th August 2007
* Version: 1.0
* Programmer: John Leung
*
* All Rights Reserved
*
*******************************************************************************************************************
*/
#include <REG51RB2.H>
#include "hdc1600.h"
#include "delay.h"
//#include "squares.h"
/*
*******************************************************************************************************************
Due to 2k code constraint of the Keil C Eval version, there is not enough code space for displaying
both system font writing and bmp definition.
Therefore we choose either one.
Option (A): Display bmp like squares.h, uncomment the line #include "squares.h" below
Uncomment cDispPatAt(64, 64, &squares[0]); in main()
Comment the line #define PIXEL_FONT_EN 1 in hdc1600.h
Comment the line "cDispStrAt(0,0, "ABCDEFGHI...." in main()
Option (B): Display system font. This is the default operation here.
#define PIXEL_FONT_EN 1 in hdc1600.h to enable system font
This allows function call for cDispStrAt()
Remember to comment the lines #include "sqaures.h" in the header section
cDisprPatAt(64, 64, &squares[0]) in main() below
*******************************************************************************************************************
*/
/*
*******************************************************************************************************************
* MAIN
*******************************************************************************************************************
*/
void main (void)
{
cDispInit();
cDispBackLite(ENABLE);
cDispClr(RGB(31,63,31));
for(;;)
{
cDispStrAt(0,0, "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890~!+_#$%", 1, RGB(31,63,31));
//cDisprPatAt(64, 64, &squares[0]);
DelayMs(1000);
cDispClr(RGB(0,63,0));
DelayMs(1000);
cDispClr(RGB(0,0,31));
DelayMs(1000);
cDispClr(RGB(31,0,0));
DelayMs(1000);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -