⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 用凌阳SPCE061A在LCD上显示文字、图形 A0-A7连接LCD的DB0-DB7
💻 C
字号:
//======================================================
//  The information contained herein is the exclusive property of
//  Sunnnorth Technology Co. And shall not be distributed, reproduced,
//  or disclosed in whole in part without prior written permission.
//          (C) COPYRIGHT 2003  SUNNORTH TECHNOLOGY CO.
//                       ALL RIGHTS RESERVED
//  The entire notice above must be reproduced on all authorized copies.
//========================================================

//============================================================
//  工程名称:splc501.spj
//  功能描述: 在LCD上显示文字、图形
//  硬件连接:A0-A7连接LCD的DB0-DB7,B3、B4、B5连接LCD的A0、R/W、EP,LCD的CS可连接到DGND
//  文件来源:《实验仪实验指导书》"实验二十五 LCD字符、图形显示"  第88页
//     
//  IDE环境:   SUNPLUS u'nSPTM  IDE 1.8.4
//
//  涉及的库:
//  组成文件:
//          SPLC501hardware.asm/SPLC501sys.asm/SPLC501var.asm         
//    	    splc501c.inc/splc501c_io.inc/hardware.inc/lab_parameter.h       
//===============================================

//============================================================
// 文件名称:main.c 
// 实现功能: 在LCD上显示文字、图形
//============================================================

#include "lab_parameter.h"
extern mode2;
extern dance1;
extern w1;
//============================================================= 
// 函数名称:   main()
// 功能描述:  在LCD上显示文字、图形
// 语法格式:  main()
//入口参数:     无
// 出口参数:    无
// 注意事项:    仅为用户模型
//=============================================================
main()
{
    Init_irq5();
	Init_sys();	
	FG_InitGraphic();
	FG_SetLineStyle(3);
	FG_Ellipse(60,30,15,15);			//画椭圆
	FG_PutStr("I LOVE YOU!",3,100,60);
	FG_PutStr("SUNPLUS",3,90,20);		//送字串
	F_Delay();
	FG_ClearScreen(1);					//以全黑清屏
	FG_PutPixel(30,30);
	FG_ClearScreen(0);
	FG_PutPixel(30,30);
	F_Delay();
	FG_ClearScreen(1);
	FG_PutPixel(30,30,1);
	FG_ClearScreen(0);
	FG_PutPixel(30,30,1);
	FG_ClearScreen(1);
	FG_PutPixel(30,30,2);
	FG_ClearScreen(0);
	FG_PutPixel(30,30,2);
	FG_SetLineStyle(0);
	FG_PutPixel(30,29);
	FG_SetBMPMode(DG_BMP_COVER);
	FG_ClearScreen(1);
	F_Delay();
	FG_PutBitmap(&mode2,127,64);		//画点图,点图信息在于mode2中
	FG_ClearScreen(0);
	FG_PutBitmap(&mode2,127,64);
	FG_SetBMPMode(DG_BMP_CLEAR);
	FG_ClearScreen(1);
	FG_PutBitmap(&mode2,127,64);
	FG_ClearScreen(0);
	FG_PutBitmap(&mode2,127,64);
	FG_SetBMPMode(DG_BMP_XOR);
	FG_ClearScreen(1);
	FG_PutBitmap(&mode2,127,64);
	FG_ClearScreen(0);
	FG_PutBitmap(&mode2,127,64);
	FG_ClearScreen(1);
	F_Delay();
	FG_GetCharHeight("a",tiny);
	FG_GetCharHeight("a",small);
	FG_GetCharHeight("a",smallb);
	FG_GetCharHeight("a",large);
	FG_GetCharHeight("a",narrow);
	FG_SetLineStyle(DG_LINE_HOLLOW_ERASE);		//修改画线类型
	FG_Rectangle(10,10,30,40);
	FG_SetLineStyle(0);							//画框
	FG_PutPixel(30,30);
	FG_SetLineStyle(0);
	FG_PutPixel(30,29);
	FG_SetLineStyle(DG_RECT_DOTTED);
	FG_Rectangle(10,10,30,40);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -