38 lines
801 B
C
38 lines
801 B
C
#include "STC15F2K60S2.H"
|
|
#include "displayer.h"
|
|
#include "key.H"
|
|
#include "sys.H"
|
|
|
|
code unsigned long SysClock = 11059200; //必须。定义系统工作时钟频率(Hz),用户必须修改成与实际工作频率(下载时选择的)一致
|
|
|
|
// the hex digit tube code of H
|
|
code char decode_table[] = {0x76, 0x00};
|
|
|
|
void displayH()
|
|
{
|
|
char key1 = GetKeyAct(enumKey1);
|
|
if (key1 == enumKeyPress)
|
|
{
|
|
Seg7Print(1, 1, 1, 1, 1, 1, 1, 0);
|
|
}
|
|
else if (key1 == enumKeyRelease)
|
|
{
|
|
Seg7Print(1, 1, 1, 1, 1, 1, 1, 1);
|
|
}
|
|
}
|
|
|
|
void main()
|
|
{
|
|
KeyInit();
|
|
DisplayerInit();
|
|
SetDisplayerArea(0, 7);
|
|
Seg7Print(1, 1, 1, 1, 1, 1, 1, 1);
|
|
LedPrint(0);
|
|
SetEventCallBack(enumEventKey, displayH);
|
|
MySTC_Init();
|
|
while (1)
|
|
{
|
|
MySTC_OS();
|
|
}
|
|
}
|