Uploaded from my local repository
[433Utils_NP] / rc-switch / examples / ReceiveDemo_Advanced / ReceiveDemo_Advanced.pde
1 /*
2   Example for receiving
3   
4   https://github.com/sui77/rc-switch/
5   
6   If you want to visualize a telegram copy the raw data and 
7   paste it into http://test.sui.li/oszi/
8 */
9
10 #include <RCSwitch.h>
11
12 RCSwitch mySwitch = RCSwitch();
13
14 void setup() {
15   Serial.begin(9600);
16   mySwitch.enableReceive(0);  // Receiver on interrupt 0 => that is pin #2
17 }
18
19 void loop() {
20   if (mySwitch.available()) {
21     output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
22     mySwitch.resetAvailable();
23   }
24 }
Contact me: dev (at) shalnoff (dot) com
PGP fingerprint: A6B8 3B23 6013 F18A 0C71 198B 83D8 C64D 917A 5717