平凡最真 发表于 2014-4-12 14:39
你好 我打开COM3接收的时候接收到的就是8个数字的 不是Raw那种格式 要怎么样才能接收到Raw这种格式
http://www.geek-workshop.com/for ... amp;extra=#pid23274
这篇里有:
原始数据怎么得到的?看IRemote库里面的例子代码IRrecvdump和IRrecord,里面帮你通过串口打印出来这些数据了。
要想发送成功,不能发送“0x30D0000A”,要发送原始数据,通过sendRaw函数发送。
irsend.sendRaw(rawCodes, codeLen, 38);
rawCodes就是上面的原始数据,codeLen是这个原始数据的长度,38是38khz的意思。
ARDUINO 代码复制打印
//定义下原始数据
unsigned int rawCodes_num9[100] = {
3550 ,1800 ,350 ,400 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,400 ,350 ,1350 ,350 ,400 ,350 ,1400 ,300 ,400 ,350 ,400 ,350 ,1400 ,300 ,1400 ,350 ,350 ,350 ,1400 ,350 ,350 ,400 ,350 ,350 ,400 ,350 ,400 ,350 ,1400 ,300 ,1400 ,350 ,350 ,400 ,1350 ,350 ,350 ,400 ,350 ,400 ,350 ,350 ,400 ,350 ,400 ,350 ,1400 ,300 ,1400 ,350 ,350 ,400 ,350 ,350 ,1400 ,350 ,350 ,400 ,350 ,350 ,1400 ,350 ,1350 ,350 ,1350 ,350 ,350 ,400 ,350 ,400
};
//发送时使用下面的语句测试
irsend.sendRaw(rawCodes_num9, 100, 38);
|