2022-08-22 15:02:29 +08:00
|
|
|
// sender
|
2022-08-22 14:51:00 +08:00
|
|
|
#include "STC15F2K60S2.H"
|
|
|
|
#include "sys.h"
|
2022-08-22 15:02:29 +08:00
|
|
|
#include "IR.h"
|
2022-08-22 14:51:00 +08:00
|
|
|
|
|
|
|
code unsigned long SysClock = 11059200; //必须。定义系统工作时钟频率(Hz),用户必须修改成与实际工作频率(下载时选择的)一致
|
2022-08-22 15:02:29 +08:00
|
|
|
char num[5]={0x01,0x03,0x05,0x07,0x09};
|
|
|
|
int countdown=3;
|
2022-08-22 14:51:00 +08:00
|
|
|
|
2022-08-22 15:02:29 +08:00
|
|
|
void sendData()
|
2022-08-22 14:51:00 +08:00
|
|
|
{
|
|
|
|
int i;
|
2022-08-22 15:02:29 +08:00
|
|
|
if(countdown)
|
2022-08-22 14:51:00 +08:00
|
|
|
{
|
2022-08-22 15:02:29 +08:00
|
|
|
countdown--;
|
|
|
|
}
|
|
|
|
countdown=10;
|
|
|
|
IrPrint(num,5);
|
|
|
|
for(i=0;i<5;i++)
|
|
|
|
{
|
|
|
|
num[i]++;
|
|
|
|
if(num[i]>0x09)
|
|
|
|
{
|
|
|
|
num[i]=0x01;
|
|
|
|
}
|
2022-08-22 14:51:00 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2022-08-22 15:02:29 +08:00
|
|
|
IrInit(NEC_R05d);
|
|
|
|
SetEventCallBack(enumEventSys1S,sendData);
|
2022-08-22 14:51:00 +08:00
|
|
|
MySTC_Init();
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
MySTC_OS();
|
|
|
|
}
|
|
|
|
}
|