|
0.png (72.85 KB, 下載次數: 148)
下載附件
2016-9-11 22:17 上傳
本例程可以實現用stc的51單片機來控制進行紅外線的發射,
完整keil工程文件下載:
http://www.zg4o1577.cn/bbs/dpj-55490-1.html
下面是部分程序代碼的預覽:
主程序:
- #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;//定義通道&快捷鍵結構體
- uint8_t IRSendOrRemote_Flag = Function_IRsend;//定義需要實現的是紅外發射還是紅外接收
- void main(void)
- {
- IRsend_Init();
- IRreceiver_Init();
- Nokia5110_Init();
- ReadE2P_ChannelShortKey();//讀取設置的通道和快捷鍵
- Nokia5110_DispChannelKey();//顯示設置的通道和快捷鍵
-
- while(1)
- {
- Funtion_KeyScan();
- if(IRSendOrRemote_Flag == Function_IRsend) //紅外發送功能實現
- {
- Set_ChannelShortKey();
- ShortKeyScan_IRSendCode();
- }
- if(IRSendOrRemote_Flag == Function_IRremote)//紅外接收功能實現
- {
- IRcode_Disp();
- }
- }
- }
復制代碼
STC89Cx_it.c
|
|