📄 hs0038.asm
字号:
;********************************************************************************************************************
;** 程序名称: irReceive
;** 功能描述: 写命令到LCM摸块
;** 输 入: temp6
;
;** 输 出:无
;** 功 能:通过红外线接收头接收遥控器的解码
;********************************************************************************************************************/
irReceive:
CBR R_Flag,(1<<B_IrStartBit)|(1<<B_IrEnd)|(1<<B_IrWrongBit) ;Clear lower 3 bit
CLR R_PulseBit
irReceive_loop:
SBRC R_Flag,B_IrWrongBit
JMP irReceive
SBRS R_Flag,B_IrEnd ;是否成功接收到遥控码
JMP irReceive_loop
LDS temp1,R_IrDataL ;通过LCD1602显示接收的遥控代码
RCALL hex_To_BCD2
PUSH temp1
MOV temp1,temp2
RCALL Hex_To_Symbol
STS R_LCD1602Buf+20,temp1
POP temp1
RCALL Hex_To_Symbol
STS R_LCD1602Buf+21,temp1
LDS temp1,R_IrDataH
RCALL hex_To_BCD2
PUSH temp1
MOV temp1,temp2
RCALL Hex_To_Symbol
STS R_LCD1602Buf+29,temp1
POP temp1
RCALL Hex_To_Symbol
STS R_LCD1602Buf+30,temp1
RCALL DispLCD1602Buf
SBI PORTB,1 ;蜂鸣器发声
SBI PORTB,2 ;继电器吸合
CALL Delay_500ms
CBI PORTB,1 ;蜂鸣器静音
CBI PORTB,2 ;继电器断开
JMP irReceive
irReceive_ex:
RET
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -