📄 main.c
字号:
#include "option.h"
#include "def.h"
#include "44b.h"
#include "44blib.h"
#include "LCDdriver.h"
#include "FONT.h"
#include <string.h>
void LCD_RunPage(void)
{
U8 i,j;
for(i=0;i<240;i++)
{
LCD_WByte(i,0,0x40);
LCD_WByte(i,3,0x02);
}
LCD_CAstr(2,1,"``",0,0);
LCD_CAstr(22,1,"LZK-3G",0,1);
LCD_CAstr(74,1,"同步电动机励磁装置",0,0);
LCD_CAstr(222,1,"<<",0,0);
for(i=167;i<233;i++)
{
LCD_WByte(i,3,0x82);
LCD_WByte(i,12,0x01);
}
for(i=4;i<12;i++)
{
LCD_WByte(167,i,0xff);
LCD_WByte(232,i,0xff);
}
for(j=4;j<12;j++)
for(i=168;i<232;i++)
LCD_WByte(i,j,Static[(j-4)*64+i-168]);
//for(j=4;j<11;j++)
//for(i=168;i<232;i++)
//LCD_WByte(i,j,Swave[(j-4)*64+i-168]);
LCD_CAstr(16,4,"励磁电压:",0,0);
LCD_CAstr(16,6,"励磁电流:",0,0);
LCD_CAstr(16,8,"触发角度:",0,0);
LCD_CAstr(16,10,"功率因树:",0,0);
LCD_CAstr(16,12,"运行模式:",0,0);
}
void Main(void)
{
rSYSCFG=CACHECFG; // Using 8KB Cache//
Port_Init();
LCD_Initialize();
LCD_ClearAll();
LCD_Bled(1);
Uart_Init(0,9600);
Delay(10);
Uart_Select(0);
//Uart_GetKey();
//Uart_SendByte(U8 data);
//Uart_SendString(char *pt);
while(1)
{
switch(Uart_GetKey())
{
case 1:
LCD_CAstr(16,4,"励磁电压:",0,0);
Uart_SendByte(100);
break;
case 2:
LCD_CAstr(16,6,"励磁电流:",0,0);
Uart_SendByte(200);
break;
case 3:
LCD_CAstr(16,8,"触发角度:",0,0);
Uart_SendByte(0xaa);
break;
case 4:
LCD_CAstr(16,10,"功率因树:",0,0);
Uart_SendString("english\tneedyou");
break;
case 5:
Uart_SendString("english\nneedyou");
LCD_ClearAll();
break;
default:break;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -