|
|

楼主 |
发表于 2014-8-29 00:20:02
|
显示全部楼层
xiaoesky 发表于 2014-8-28 22:38 
/*
Simple example for receiving
[pre lang="arduino" line="1" file="ReceiveDemo_Advanced"]/*
Example for receiving
http://code.google.com/p/rc-switch/
If you want to visualize a telegram copy the raw data and
paste it into http://test.sui.li/oszi/
*/
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
Serial.begin(9600);
mySwitch.enableReceive(0); // Receiver on inerrupt 0 => that is pin #2
}
void loop() {
if (mySwitch.available()) {
output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
mySwitch.resetAvailable();
}
}[/code]
使用这个程序,接收到的信号:
风扇开关
Decimal: 13846320 (24Bit) Binary: 110100110100011100110000 Tri-State: 1F01F0F10100 PulseLength: 266 microseconds Protocol: 1
Raw data: 8264,784,268,784,272,260,804,780,276,256,804,260,804,784,268,784,268,260,804,784,272,260,800,264,800,260,804,784,268,784,272,780,272,260,804,256,808,780,272,780,272,260,804,260,804,256,808,256,804,
如何发送这类的信号呢? |
|