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

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
jlogreira3
Date:
Thu Apr 28 19:50:53 2016 +0000
Commit message:
Code that reads IR signals to create a PC Remote for mbed.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Apr 28 19:50:53 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/082adc85693f
\ No newline at end of file