Code that reads IR signals to create a PC remote for mBED.

Dependencies:   mbed

Revision:
0:a2ae3dcce8c4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Apr 28 19:50:53 2016 +0000
@@ -0,0 +1,27 @@
+#include "mbed.h"
+
+Serial receiver(p28, p27); // tx, rx
+Serial pc(USBTX, USBRX); // tx, rx
+DigitalOut myled1(LED1);
+DigitalOut myled2(LED2);
+
+int main()
+{
+    receiver.baud(2400);
+    pc.baud(2400);
+    while(1)
+    {
+        if(pc.readable())
+        {
+            myled1 = 1;
+            receiver.putc(pc.getc());
+            myled1 = 0;
+        }
+        if(receiver.readable())
+        {
+            myled2 = 1;
+            pc.printf("%x ", receiver.getc());
+            myled2 = 0;
+        }
+    }
+}
\ No newline at end of file