Skip to content

Instantly share code, notes, and snippets.

@IOT-123
Created January 20, 2018 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IOT-123/5d52d352e16cb8360f64fb15232fc733 to your computer and use it in GitHub Desktop.
Save IOT-123/5d52d352e16cb8360f64fb15232fc733 to your computer and use it in GitHub Desktop.
One of https://github.com/sui77/rc-switch/ demos with pins included for D1M RFTXRX BLOCK.
/*
Example for receiving
https://github.com/sui77/rc-switch/
If you want to visualize a telegram copy the raw data and
paste it into http://test.sui.li/oszi/
modified fo D1M RFTXRX BLOCK pins
*/
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
Serial.begin(9600);
mySwitch.enableReceive(D4); // D1 or D2 or D3 or D4
}
void loop() {
if (mySwitch.available()) {
output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
mySwitch.resetAvailable();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment