Things used in this project

Hardware components:
Msp exp430f5529lp 5529 lp angle%5b1%5d
TI LaunchPad MSP-EXP430F5529LP MSP430 LaunchPad
×1
Cc3100boost cc3100boost no bg resize
TI LaunchPad CC3100BOOST SimpleLink Wi-Fi BoosterPack
×1
SeeedStudio grove IR module
×1
Software apps and online services:
Blynk logo avatars
Blynk
Energiabadgelogo2
TI LaunchPad Energia

Code

smartBoseC/C++
The main energia sketch uploaded to the LaunchPad
#include <IRSendRev.h>
#define BIT_LEN         0
#define BIT_START_H     1
#define BIT_START_L     2
#define BIT_DATA_H      3
#define BIT_DATA_L      4
#define BIT_DATA_LEN    5
#define BIT_DATA        6
#define commandMax      4
const int ir_freq = 38;                 // 38k
IRSendRev IR;

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <SPI.h>
#include <WiFi.h>
#include <BlynkSimpleTI_CC3200_LaunchXL.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "XXXXXXX";

// Your WiFi credentials
char ssid[] = "XXXXX";
char pass[] = "XXXXX";        // Set to "" for open networks


struct cmd_t{
  unsigned char dta[20];
} IRout[commandMax];

 
void setup()
{
    dtaInit();
    IR.setSend(40);
    pinMode(pb1,INPUT_PULLUP);
    Serial.begin(9600);
    Blynk.begin(auth, ssid, pass);
}
  int i =0;
void loop()
{
  Blynk.run();
  if (digitalRead(pb1) == 0){
    //Serial.print("Sending IRout ");
    //Serial.println(i);
    IR.Send(IRout[i++].dta, 38);
    while(digitalRead(pb1) == 0){
    }
    if(i>3){
      i=0;
    }
  }
    delay(100);
}

void dtaInit()
{
    //Power
    IRout[0].dta[BIT_LEN]        = 9;			// all data that needs to be sent
    IRout[0].dta[BIT_START_H]    = 180;			// the logic high duration of "Start"
    IRout[0].dta[BIT_START_L]    = 91;			// the logic low duration of "Start"
    IRout[0].dta[BIT_DATA_H]     = 11;			// the logic "long" duration in the communication
    IRout[0].dta[BIT_DATA_L]     = 33;			// the logic "short" duration in the communication
    IRout[0].dta[BIT_DATA_LEN]   = 4;			// Number of data which will sent. If the number is other, you should increase or reduce dtaSend[BIT_DATA+x].
    IRout[0].dta[BIT_DATA+0]     = 93;			// data that will sent
    IRout[0].dta[BIT_DATA+1]     = 210;
    IRout[0].dta[BIT_DATA+2]     = 50;
    IRout[0].dta[BIT_DATA+3]     = 205;
    //Set Input
    IRout[1].dta[BIT_LEN]        = 9;			// all data that needs to be sent
    IRout[1].dta[BIT_START_H]    = 180;			// the logic high duration of "Start"
    IRout[1].dta[BIT_START_L]    = 91;			// the logic low duration of "Start"
    IRout[1].dta[BIT_DATA_H]     = 11;			// the logic "long" duration in the communication
    IRout[1].dta[BIT_DATA_L]     = 33;			// the logic "short" duration in the communication
    IRout[1].dta[BIT_DATA_LEN]   = 4;			// Number of data which will sent. If the number is other, you should increase or reduce dtaSend[BIT_DATA+x].
    IRout[1].dta[BIT_DATA+0]     = 93;			// data that will sent
    IRout[1].dta[BIT_DATA+1]     = 210;
    IRout[1].dta[BIT_DATA+2]     = 168;
    IRout[1].dta[BIT_DATA+3]     = 87;
    //Voluem Up
    IRout[2].dta[BIT_LEN]        = 9;			// all data that needs to be sent
    IRout[2].dta[BIT_START_H]    = 180;			// the logic high duration of "Start"
    IRout[2].dta[BIT_START_L]    = 91;			// the logic low duration of "Start"
    IRout[2].dta[BIT_DATA_H]     = 11;			// the logic "long" duration in the communication
    IRout[2].dta[BIT_DATA_L]     = 33;			// the logic "short" duration in the communication
    IRout[2].dta[BIT_DATA_LEN]   = 4;			// Number of data which will sent. If the number is other, you should increase or reduce dtaSend[BIT_DATA+x].
    IRout[2].dta[BIT_DATA+0]     = 93;			// data that will sent
    IRout[2].dta[BIT_DATA+1]     = 210;
    IRout[2].dta[BIT_DATA+2]     = 192;
    IRout[2].dta[BIT_DATA+3]     = 63;
    //Volume Down
    IRout[3].dta[BIT_LEN]        = 9;			// all data that needs to be sent
    IRout[3].dta[BIT_START_H]    = 180;			// the logic high duration of "Start"
    IRout[3].dta[BIT_START_L]    = 91;			// the logic low duration of "Start"
    IRout[3].dta[BIT_DATA_H]     = 11;			// the logic "long" duration in the communication
    IRout[3].dta[BIT_DATA_L]     = 33;			// the logic "short" duration in the communication
    IRout[3].dta[BIT_DATA_LEN]   = 4;			// Number of data which will sent. If the number is other, you should increase or reduce dtaSend[BIT_DATA+x].
    IRout[3].dta[BIT_DATA+0]     = 93;			// data that will sent
    IRout[3].dta[BIT_DATA+1]     = 210;
    IRout[3].dta[BIT_DATA+2]     = 64;
    IRout[3].dta[BIT_DATA+3]     = 191;
}
IRGroveC/C++
Seeed's arduino Library for the IR emitter modified for the TI Launchpad
No preview (download only).
BlynkLibC/C++
Modified Blynk library to work with CC3100 BoosterPack (small, debugging changes)
No preview (download only).
IR ReceiveC/C++
Used to receive an IR signal and print the results to the serial monitor. Helpful for trying to figure out codes to emit
#include <IRSendRev.h>
 
#define BIT_LEN         0
#define BIT_START_H     1
#define BIT_START_L     2
#define BIT_DATA_H      3
#define BIT_DATA_L      4
#define BIT_DATA_LEN    5
#define BIT_DATA        6
#define LED GREEN_LED 
const int pinRecv = 2;              // ir receiver connect to D2
IRSendRev IR; 
    boolean state = 0;
void setup()
{
    Serial.begin(115200);
    IR.Init(5);
    Serial.println("init over");
    pinMode(LED,OUTPUT);

    digitalWrite(LED,LOW);
}
 
unsigned char dta[20];
 
void loop()
{
    if(IR.IsDta())                  // get IR data
    {
        IR.Recv(dta);               // receive data to dta
 
        Serial.println("+------------------------------------------------------+");
		Serial.print("LEN = ");
        Serial.println(dta[BIT_LEN]);
        Serial.print("START_H: ");
        Serial.print(dta[BIT_START_H]);
        Serial.print("\tSTART_L: ");
        Serial.println(dta[BIT_START_L]);
 
        Serial.print("DATA_H: ");
        Serial.print(dta[BIT_DATA_H]);
        Serial.print("\tDATA_L: ");
        Serial.println(dta[BIT_DATA_L]);
 
        Serial.print("\r\nDATA_LEN = ");
        Serial.println(dta[BIT_DATA_LEN]);
 
		Serial.print("DATA: ");
        for(int i=0; i<dta[BIT_DATA_LEN]; i++)
        {
            Serial.print("0x");
            Serial.print(dta[i+BIT_DATA], HEX);
            Serial.print("\t");
        }
        Serial.println();
 
		Serial.print("DATA: ");
        for(int i=0; i<dta[BIT_DATA_LEN]; i++)
        {
            Serial.print(dta[i+BIT_DATA], DEC);
            Serial.print("\t");
        }
        Serial.println();
        Serial.println("+------------------------------------------------------+\r\n\r\n");
    }
    if(dta[BIT_DATA] == 100){
      state = !state;
      digitalWrite(LED,state);
    }
    dta[BIT_DATA] = 0;
}

Credits

81a21a12aab58cdfe8d1306c85500e45
Chris Roberts

I am an applications engineer with Texas Instruments working with the Launchpad by trade, and a maker by passion!

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Calliope Heart Rate Sensor
Intermediate
  • 129
  • 4

Full instructions

Use a Calliope Mini and a Grove Heart Rate Sensor to visualize the heartbeats via the LED screen and calculate the BPM (beats per minute).

Automated Shower Boiler
Intermediate
  • 85
  • 2

Full instructions

Do you live in a country where you use solar energy to warm up the water? Well, how about we automate the process of the shower boiler.

LED Sound Meter using Wio-Link and Node-Red
Intermediate
  • 58
  • 2

Protip

SeeedStudio Grove sound sensor and LED strip attached to Wio-Link being driven by a Node-Red flow

Automatic Gardening System with NodeMCU and Blynk
Intermediate
  • 1,018
  • 10

Full instructions

Controlling water and heat of a plantation, using real data as temperature, relative air humidity, and soil moisture.

Amazon Smart Medicine Dash Box
Intermediate
  • 278
  • 3

Full instructions

The smart medicine dash box allows user to visualize the contents of the medicine in real time (via mobile apps) and notifies when low.

How to Add an LED with Blynk on Linux
Intermediate
  • 237
  • 4

Full instructions

An LED that will be on or off.

ProjectsCommunitiesContestsLiveJobsBetaFree StoreBlogAdd projectSign up / Login
Respect project