st-anything/lib/RCSwitch/examples/ReceiveDemo_Advanced/ReceiveDemo_Advanced.pde

25 lines
593 B
Plaintext
Raw Permalink Normal View History

2023-03-11 14:11:03 +00:00
/*
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();
}
}