eecs-bsp-test-code-2/3-2/main.c

39 lines
679 B
C

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