資源簡介
本程序針對HUB12接口設計的程序! 可單鍵控制循環顯示
代碼片段和文件信息
#include?
#include?“font.h“
sbit?Key=P3^4;
sbit?LOE=P1^0;
sbit?LA=P1^1;
sbit?LB=P1^2;
sbit?LClk=P1^3;
sbit?LSCLK=P1^4;
sbit?LR=P1^5;
//按鍵值
unsigned?char?KeyValue=0x01;
//當前顯示索引值
unsigned?char?FontsIndex=0x00;
void?TimerInit(void);
void?KeyProc(unsigned?char?KeyValue);
void?WriteData(unsigned?char?Value);
void?Delayms(unsigned?char?Value);
/***********主函數**************/
void?main()
{
TimerInit();
IE=0x82; //打開中斷
while(0x01)
{
if(Key!=KeyValue)
{
Delayms(0x0A);
if(Key!=KeyValue)
{
KeyValue=Key;
KeyProc(KeyValue);
}
}
}
}
/*********************************/
/**********定時器初始化***********/
void?TimerInit(void)
{
TMOD=0x01; //定時器0工作于16模式
TH0=0xEE;? //0x4C使用定時器0方式111.0592MHz晶振5ms中斷一次
TL0=0x00; //0x00
TR0=0x01; //開始定時器0
}
/*********************************/
/************按鍵處理過程***********/
void?KeyProc(unsigned?char?KeyValue)
{
if(!KeyValue)?FontsIndex=(FontsIndex<0x0B)?(FontsInde
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????7017??2016-01-19?20:41??SourceCode\Bin\LedScreen
?????文件???????4095??2016-01-19?20:41??SourceCode\Bin\LedScreen.hex
?????文件?????????82??2016-01-19?20:41??SourceCode\Bin\LedScreen.lnp
?????文件??????12871??2016-01-19?20:41??SourceCode\Bin\LedScreen.plg
?????文件???????7975??2016-01-19?20:41??SourceCode\Bin\main.obj
?????文件???????7569??2016-01-19?20:41??SourceCode\LedScreen.m51
?????文件???????3002??2016-01-16?21:09??SourceCode\LedScreen.plg
????.......?????67749??2016-01-19?20:41??SourceCode\LedScreen.uvgui.羅鋼
????.......?????67749??2016-01-19?20:41??SourceCode\LedScreen.uvgui_羅鋼.bak
????.......??????5195??2016-01-19?20:41??SourceCode\LedScreen.uvopt
????.......?????13327??2016-01-16?19:08??SourceCode\LedScreen.uvproj
????.......??????5197??2016-01-19?20:41??SourceCode\LedScreen_uvopt.bak
????.......?????????0??2016-01-16?19:06??SourceCode\LedScreen_uvproj.bak
?????文件???????5300??2016-01-19?20:41??SourceCode\main.lst
?????文件???????4316??2016-01-19?20:39??SourceCode\User\font.h
?????文件???????2600??2016-01-19?20:41??SourceCode\User\main.c
?????目錄??????????0??2016-01-19?20:41??SourceCode\Bin
?????目錄??????????0??2016-01-19?20:41??SourceCode\User
?????目錄??????????0??2016-01-19?20:41??SourceCode
-----------?---------??----------?-----??----
???????????????214044????????????????????19
- 上一篇:北郵編譯原理實驗 語法分析
- 下一篇:需求跟蹤矩陣 V2.0
評論
共有 條評論