http://code.google.com/p/rc-switch/
[Arduino] / libraries / RCSwitch / .svn / pristine / 4b / 4baac92a9e8fe4a31210c864f750421bbf0dbea8.svn-base
diff --git a/libraries/RCSwitch/.svn/pristine/4b/4baac92a9e8fe4a31210c864f750421bbf0dbea8.svn-base b/libraries/RCSwitch/.svn/pristine/4b/4baac92a9e8fe4a31210c864f750421bbf0dbea8.svn-base
new file mode 100644 (file)
index 0000000..a345535
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+  Example for receiving
+  
+  http://code.google.com/p/rc-switch/
+  
+  If you want to visualize a telegram copy the raw data and 
+  paste it into http://test.sui.li/oszi/
+*/
+
+#include <RCSwitch.h>
+
+RCSwitch mySwitch = RCSwitch();
+
+void setup() {
+  Serial.begin(9600);
+  mySwitch.enableReceive(0);  // Receiver on inerrupt 0 => that is pin #2
+}
+
+void loop() {
+  if (mySwitch.available()) {
+    output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());
+    mySwitch.resetAvailable();
+  }
+}\r