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 Aug 01 13:46:03 2014 +0000
Parent:
14:b00d0c5ba8e3
Parent:
12:a7d9b4f303fd
Child:
16:0891823672f4
Commit message:
Merge pull request 'new bt interface'

Changed in this revision

IR.cpp Show diff for this revision Revisions of this file
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
--- a/main.cpp	Fri Aug 01 13:06:27 2014 +0000
+++ b/main.cpp	Fri Aug 01 13:46:03 2014 +0000
@@ -1,7 +1,8 @@
 #include "mbed.h"
 #include "TxIR.hpp"
 
-#define LOG_LEVEL_VERBOSE
+#define LOG_LEVEL_ERROR
+#include "Log.h"
 #include "Puck.h"
 
 Puck* puck = &Puck::getPuck();
@@ -21,13 +22,13 @@
 #define COMMAND_BEGIN_CODE_TRANSMISSION 0
 #define COMMAND_END_CODE_TRANSMISSION 1
 
-
 void onCommandWrite(uint8_t* value) {
     switch(value[0]) {
         case COMMAND_BEGIN_CODE_TRANSMISSION:
             receiveIndex = 0;
             break;
         case COMMAND_END_CODE_TRANSMISSION:
+            puck->getBle().disconnect();
             LOG_INFO("Going to fire IR code...\n");
             txir.txSeq(period, DATA_BUFFER_SIZE, dataBuffer);
             LOG_INFO("Fire complete!\n");
@@ -53,8 +54,10 @@
     puck->addCharacteristic(IR_SERVICE_UUID, DATA_UUID, 20);
     puck->addCharacteristic(IR_SERVICE_UUID, PERIOD_UUID, 1);
     puck->init(0xABBA);
+
     puck->onCharacteristicWrite(&COMMAND_UUID, onCommandWrite);
     puck->onCharacteristicWrite(&DATA_UUID, onDataWrite);
     puck->onCharacteristicWrite(&PERIOD_UUID, onPeriodWrite);
+
     while (puck->drive());
 }
\ No newline at end of file