|
0.png (72.85 KB, 下載次數(shù): 148)
下載附件
2016-9-11 22:17 上傳
本例程可以實(shí)現(xiàn)用stc的51單片機(jī)來控制進(jìn)行紅外線的發(fā)射,
完整keil工程文件下載:
http://www.zg4o1577.cn/bbs/dpj-55490-1.html
下面是部分程序代碼的預(yù)覽:
主程序:
- #include "IR_SendCode.h"
- #include "IR_SendDisp.h"
- #include "IR_Receive.h"
- #include "ChannelShortcutDef.h"
- #include "Nokia5110.h"
- #include "delay.h"
- ChannelKey_TypeDef Channel_ShortKey;//定義通道&快捷鍵結(jié)構(gòu)體
- uint8_t IRSendOrRemote_Flag = Function_IRsend;//定義需要實(shí)現(xiàn)的是紅外發(fā)射還是紅外接收
- void main(void)
- {
- IRsend_Init();
- IRreceiver_Init();
- Nokia5110_Init();
- ReadE2P_ChannelShortKey();//讀取設(shè)置的通道和快捷鍵
- Nokia5110_DispChannelKey();//顯示設(shè)置的通道和快捷鍵
-
- while(1)
- {
- Funtion_KeyScan();
- if(IRSendOrRemote_Flag == Function_IRsend) //紅外發(fā)送功能實(shí)現(xiàn)
- {
- Set_ChannelShortKey();
- ShortKeyScan_IRSendCode();
- }
- if(IRSendOrRemote_Flag == Function_IRremote)//紅外接收功能實(shí)現(xiàn)
- {
- IRcode_Disp();
- }
- }
- }
復(fù)制代碼
STC89Cx_it.c
|
|