📄 main.c
字号:
#include <regx52.h>
#include <stdio.h>
#include "ir.h"
#include "1602.h"
extern bit irok;
extern unsigned char ircode[4];
char tab[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b','c','d', 'e', 'f'};
void main()
{
char buf[16] = "code:";
ir_init();
lcd_init();
lcd_setpos(0, 1);
lcd_printf("code:");
while(1)
{
if(irok == 1)
{
irok = 0;
ir_pro();
buf[5] = tab[ircode[0]/16];
buf[6] = tab[ircode[0]%16];
buf[7] = ' ';
buf[8] = tab[ircode[1]/16];
buf[9] = tab[ircode[1]%16];
buf[10] = ' ';
buf[11] = tab[ircode[2]/16];
buf[12] = tab[ircode[2]%16];
buf[13] = ' ';
buf[14] = tab[ircode[3]/16];
buf[15] = tab[ircode[3]%16];
// sprintf(buf, "code:%02x-%02x", 255, 128);
// sprintf(buf, "code:%x %x %x %x", 255, 128, ircode[2], ircode[3]);
lcd_setpos(0, 1);
lcd_printf(buf);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -