IRRemote fuer Yamaha Reciever
[svn42.git] / rf433ctl / IRremote / examples / IRrecvDemo / IRrecvDemo.pde
diff --git a/rf433ctl/IRremote/examples/IRrecvDemo/IRrecvDemo.pde b/rf433ctl/IRremote/examples/IRrecvDemo/IRrecvDemo.pde
new file mode 100644 (file)
index 0000000..14982d8
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv
+ * An IR detector/demodulator must be connected to the input RECV_PIN.
+ * Version 0.1 July, 2009
+ * Copyright 2009 Ken Shirriff
+ * http://arcfn.com
+ */
+
+#include <IRremote.h>
+
+int RECV_PIN = 11;
+
+IRrecv irrecv(RECV_PIN);
+
+decode_results results;
+
+void setup()
+{
+  Serial.begin(9600);
+  irrecv.enableIRIn(); // Start the receiver
+}
+
+void loop() {
+  if (irrecv.decode(&results)) {
+    Serial.println(results.value, HEX);
+    irrecv.resume(); // Receive the next value
+  }
+}\r