📄 main.c
字号:
//======================================================================
// The information contained herein is the exclusive property of
// Sunnnorth Technology Co. And shall not be distributed, reproduced,
// or disclosed in whole in part without prior written permission.
// (C) COPYRIGHT 2003 SUNNORTH TECHNOLOGY CO.
// ALL RIGHTS RESERVED
// The entire notice above must be reproduced on all authorized copies.
//======================================================================
//====================================================================================
//工程名: SensorsMd_IRDemo.spj
//功能描述:红外接收头的遥控器接收译码,通过8个LED个观察译码后的遥控器发射码,可以通过示波器观察,验证译码是否正确
// 这个DEMO适合下面信号特征的遥控器:
// 起始低电平持续时间为16ms
// 逻辑1的占空比为3/4,逻辑0的占空比为1/1
// 逻辑1的高电平持续时间为3ms
// 请在使用遥控器前先用示波器观察信号特征,如果有其他的特征,只需要修改STime\HLTime两个数据即可.
// 该DEMO已在HS0038和TSOP1738上验证通过
//包含文件:main.c\Decode.c\isr.asm
//硬件连接:IOA7接传感器模组的RS,"+"接"+","-"接"-"(或者用一个10pin排线连接61板的J8与传感器模组的J2)
// IOA8~15连接8个LED
//维护记录:2006年6月16 v1.0 by hongyan.Feng
//====================================================================================
//====================================================================================
//文件名:main.c
//功能描述:红外接收头的遥控器接收译码并用LED显示
//维护记录:2006年6月16 by hongyan.Feng
//====================================================================================
#include "SPCE061A.h"
extern unsigned int Decode(void);
extern void RN_Initial(void);
//====================================================================================
//语法格式:int main(void)
//功能描述:红外接收头的遥控器译码主函数
//入口参数:无
//出口参数:无
//维护记录:2006年6月16 by hongyan.Feng
//====================================================================================
int main(void)
{
unsigned int iECode=0;
RN_Initial();
while(1)
{
iECode = Decode(); //调用译码函数得到译码数据
iECode = iECode<<4;
iECode = iECode<<4;
if(iECode!=0)
*P_IOA_Data &= 0x00ff;
*P_IOA_Data |= iECode; //观察LED上显示的译码值
*P_Watchdog_Clear = 0x0001;
iECode = 0;
}
}
//=====================================================================================================
//end
//=====================================================================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -