The IR Puck can mimic arbitrary infrared remote controls. Built on the Puck IOT platform.

Dependencies:   Puck IRSender mbed

The IR Puck is a puck that can mimic arbitrary infrared remote controls. This is useful for controlling things like TVs, radios, airconditioners, window blinds, and just about anything and everything that can be otherwise be controlled by a regular remote control.

A tutorial for the IR Puck is available on GitHub.

Tutorials and in-depth documentation for the Puck platform is available at the project's GitHub page

Files at this revision

API Documentation at this revision

Comitter:
stiaje
Date:
Fri Feb 27 18:53:06 2015 +0000
Parent:
18:e96a99547f54
Child:
20:73500007b95a
Commit message:
Update Puck and mbed libraries

Changed in this revision

Puck.lib Show annotated file Show diff for this revision Revisions of this file
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
--- a/Puck.lib	Wed Aug 06 13:29:51 2014 +0000
+++ b/Puck.lib	Fri Feb 27 18:53:06 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/Nordic-Pucks/code/Puck/#e620c41de9c3
+http://mbed.org/teams/Nordic-Pucks/code/Puck/#bfc682889c15
--- a/main.cpp	Wed Aug 06 13:29:51 2014 +0000
+++ b/main.cpp	Fri Feb 27 18:53:06 2015 +0000
@@ -17,7 +17,7 @@
 #include "mbed.h"
 #include "IRSender.h"
 
-#define LOG_LEVEL_ERROR
+#define LOG_LEVEL_INFO
 #include "Log.h"
 #include "Puck.h"
 
@@ -38,13 +38,13 @@
 #define COMMAND_BEGIN_CODE_TRANSMISSION 0
 #define COMMAND_END_CODE_TRANSMISSION 1
 
-void onCommandWrite(uint8_t* value) {
+void onCommandWrite(const uint8_t* value, uint8_t length) {
     switch(value[0]) {
         case COMMAND_BEGIN_CODE_TRANSMISSION:
             receiveIndex = 0;
             break;
         case COMMAND_END_CODE_TRANSMISSION:
-            puck->getBle().disconnect();
+            puck->disconnect();
             LOG_INFO("Going to fire IR code...\n");
             irpin.irSeq(period, receiveIndex, dataBuffer);
             LOG_INFO("Fire complete!\n");
@@ -53,14 +53,14 @@
 }
 
 
-void onDataWrite(uint8_t* value) {
-    for(int i = 0; i < 20 && receiveIndex < DATA_BUFFER_SIZE; i += 2) {
+void onDataWrite(const uint8_t* value, uint8_t length) {
+    for(int i = 0; i < 20 && receiveIndex < length; i += 2) {
         dataBuffer[receiveIndex++] = (value[i] << 8) | value[i + 1];
     }
 }
 
 
-void onPeriodWrite(uint8_t* value) {
+void onPeriodWrite(const uint8_t* value, uint8_t length) {
     period = value[0];
 }
 
--- a/mbed.bld	Wed Aug 06 13:29:51 2014 +0000
+++ b/mbed.bld	Fri Feb 27 18:53:06 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/04dd9b1680ae
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/9ad691361fac
\ No newline at end of file