Skip to content

Instantly share code, notes, and snippets.

@nikibobi
Created March 4, 2018 17:34
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save nikibobi/a24eedce0d79f3541aa0a10115fa6ac4 to your computer and use it in GitHub Desktop.
#include <RCSwitch.h>
#define PIN 2
RCSwitch rc = RCSwitch();
void setup() {
Serial.begin(9600);
rc.enableReceive(digitalPinToInterrupt(PIN));
}
void loop() {
if (rc.available()) {
unsigned long value = rc.getReceivedValue();
if (value) {
Serial.println(value);
}
rc.resetAvailable();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment