学习用IRremote库控制空调,dump出原始数据后,然后发送。
但是空调没反应,用红外接收头接受数据发现数据有问题,如图。
已经把接收到的第一个数据放到最后了。
发送端的代码- /*
- * An IR LED must be connected to Arduino PWM pin 3.
- * http://zhangtory.com
- * by ZhangTory
- */
- #include <IRremote.h>
- IRsend irsend;
- unsigned int rawCode_ac_open[74]={9050,-4350,700,-450,700,-500,700,-1550,700,-1550,750,-450,700,-500,650,-500,700,-500,650,-1600,700,-500,650,-500,700,-1600,650,-500,700,-500,650,-500,700,-500,650,-500,700,-500,650,-500,700,-500,650,-500,700,-500,650,-500,700,-450,700,-500,700,-450,700,-500,700,-450,700,-1600,650,-500,700,-1550,700,-500,700,-500,650,-1600,700,-450,700,9192};
- void setup()
- {
- }
- void loop() {
- irsend.sendRaw(rawCode_ac_open,74,38);
- delay(3000);
- }
复制代码 |