ReceiveDemo_Advanced.ino 594 B

123456789101112131415161718192021222324
  1. /*
  2. Example for receiving
  3. https://github.com/sui77/rc-switch/
  4. If you want to visualize a telegram copy the raw data and
  5. paste it into http://test.sui.li/oszi/
  6. */
  7. #include <RCSwitch.h>
  8. RCSwitch mySwitch = RCSwitch();
  9. void setup() {
  10. Serial.begin(9600);
  11. mySwitch.enableReceive(0); // Receiver on interrupt 0 => that is pin #2
  12. }
  13. void loop() {
  14. if (mySwitch.available()) {
  15. output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
  16. mySwitch.resetAvailable();
  17. }
  18. }