以RC5协议格式发射一组红外编码
irsend.sendRC5(IRcode, numBits);
IRcode
: 16进制的红外编码。
numBits
: 编码的位数。
无。
#include <IRremote.h> // 调用IRRemote库 IRsend irsend; // 定义发射器 void setup() { Serial.begin(9600); } void loop() { if (Serial.read() != -1) { // 如果串口接收到任意字符 irsend.sendNEC(0x1067B24D, 32); // 发射NEC协议红外编码 } }
无。