libraries / rc-switch-2.52 / examples / ReceiveDemo_Advanced / ReceiveDemo_Advanced.pdeon commit Added more libraries (5d8fbfd)
   1/*
   2  Example for receiving
   3  
   4  http://code.google.com/p/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
  12RCSwitch mySwitch = RCSwitch();
  13
  14void setup() {
  15  Serial.begin(9600);
  16  mySwitch.enableReceive(0);  // Receiver on inerrupt 0 => that is pin #2
  17}
  18
  19void loop() {
  20  if (mySwitch.available()) {
  21    output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
  22    mySwitch.resetAvailable();
  23  }
  24}