ir-puck

Dependencies:   Puck IRSender mbed

Fork of ir-puck by Nordic Pucks

Files at this revision

API Documentation at this revision

Comitter:
cristea
Date:
Fri Jul 25 09:21:13 2014 +0000
Parent:
10:35d78d589580
Commit message:
Cleanup and update IR lib

Changed in this revision

IR.cpp Show annotated file Show diff for this revision Revisions of this file
IRSender.lib Show annotated file Show diff for this revision Revisions of this file
Puck.lib Show annotated file Show diff for this revision Revisions of this file
TxIR.lib Show diff for this revision Revisions of this file
diff -r 35d78d589580 -r 5eef3c1e783e IR.cpp
--- a/IR.cpp	Thu Jul 24 09:30:43 2014 +0000
+++ b/IR.cpp	Fri Jul 25 09:21:13 2014 +0000
@@ -1,13 +1,13 @@
 #include "mbed.h"
 #include "IR.h"
-#include "TxIR.hpp"
+#include "IRSender.h"
 
 #define LOG_LEVEL_ERROR
 #include "Log.h"
 
 #define WORD(x, i) ((x)[(i)] << 8 | (x)[(i) + 1])
 
-TxIR txir(p14);
+IRSender senderPin(p14);
 Serial px(USBTX, USBRX);
 
 #define SCR_1 1260, 420
@@ -43,9 +43,9 @@
     
     if(code[0] == 17) {
         switch(code[1]) {
-            case 17: txir.txSeq(26, 50, screen_up_raw_codes); break;
-            case 18: txir.txSeq(26, 50, screen_middle_raw_codes); break;
-            case 19: txir.txSeq(26, 50, screen_down_raw_codes); break;
+            case 17: senderPin.irSeq(26, 50, screen_up_raw_codes); break;
+            case 18: senderPin.irSeq(26, 50, screen_middle_raw_codes); break;
+            case 19: senderPin.irSeq(26, 50, screen_down_raw_codes); break;
         }
         return;
     } 
@@ -73,13 +73,9 @@
     }
     raw_codes[66] = WORD(ptrail, 0);
     
-    LOG_INFO("Full sequence received: [%i", raw_codes[0]);
-    for (int i=1; i<67; i++) {
-        px.printf(", %i", raw_codes[i]);
-    }
-    LOG_INFO("]\n");
+    LOG_INFO("Full sequence received!\n");
     
-    txir.txSeq(26, 67, raw_codes);
+    senderPin.irSeq(26, 67, raw_codes);
 
 
     LOG_INFO("Wrote message :)\n");
diff -r 35d78d589580 -r 5eef3c1e783e IRSender.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IRSender.lib	Fri Jul 25 09:21:13 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/teams/Nordic-Pucks/code/IRSender/#741de6c95ae9
diff -r 35d78d589580 -r 5eef3c1e783e Puck.lib
--- a/Puck.lib	Thu Jul 24 09:30:43 2014 +0000
+++ b/Puck.lib	Fri Jul 25 09:21:13 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/cristea/code/Puck/#c07c01c2a741
+http://mbed.org/teams/Nordic-Pucks/code/Puck/#49ffd38fb401
diff -r 35d78d589580 -r 5eef3c1e783e TxIR.lib
--- a/TxIR.lib	Thu Jul 24 09:30:43 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/sigveseb/code/TxIR/#1f89d6278243