📄 irtest.c
字号:
/* remote keybord & screen
commplus.c ;
infrared.c ;
cplib.lib */
#include <stdio.h>
#include <conio.h>
#include <process.h>
#include <commplus.h>
#include <infrared.h>
extern _stklen = 4096u; /* it very useful to reduce memory in HT-1800 */
extern _heaplen = 256u; /* both stack & heap length must be set */
main()
{
unsigned char ascch, auxb, auxstat;
unsigned char workmode, commport;
unsigned int baudrate;
unsigned int inRx;
unsigned char k, iroldstat, send, akey;
if (!ComPlsInstalled()) {
printf("Complus must be installed first!!!");
exit(1);
}
printf("Press any key\r\n");
do {
} while (!kbhit());
k = getch();
printf("Turn on IR Power...\r\n");
iroldstat=IRPowerCtrl(_IRPowON);
SetIRMFreq(3800);
do {
} while (!kbhit());
k = getch();
printf("IR Output on\r\n");
SetIROutput(0);
do {
} while (!kbhit());
k = getch();
printf("IR Output off\r\n");
SetIROutput(2);
do {
} while (!kbhit());
k = getch();
GetCommMode(&workmode, &commport, &baudrate);
SetCommMode(3, 1, 1200);
EnableRx(0);
printf("Sending $55\r\n");
do {
PutAuxByte(0x55);
} while (!kbhit());
k = getch();
printf("Please input something to send ...\r\n");
send = 0;
do {
if (kbhit()) {
akey= getch();
if (akey != 27) {
if (!send)
printf("\r\n");
send = -1;
PutAuxByte(akey);
printf("%c", akey);
}
}
if (ExistAuxBGot(&auxb, &auxstat)) {
if (send)
printf("\r\n");
send = 0;
printf("%c", auxb);
}
} while (akey != 27);
iroldstat=IRPowerCtrl(_IRPowOFF);
SetIRMFreq(0);
DisableRx();
SetCommMode(workmode, commport, baudrate); /* resume comm setting */
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -