Things used in this project

Hardware components:
Cc3200 launchxl cc3200 launchxl no bg resize
TI LaunchPad CC3200-LAUNCHXL SimpleLink Wi-Fi LaunchPad
×1
Software apps and online services:
Blynk logo avatars
Blynk
Hand tools and fabrication machines:
Smartphone

Code

CC3200_BlynkC/C++
Blynk example code for the CC3200. Make sure you update with your Auth Token and WiFi credentials.
/**************************************************************
 * Blynk is a platform with iOS and Android apps to control
 * Arduino, Raspberry Pi and the likes over the Internet.
 * You can easily build graphic interfaces for all your
 * projects by simply dragging and dropping widgets.
 *
 *   Downloads, docs, tutorials: http://www.blynk.cc
 *   Blynk community:            http://community.blynk.cc
 *   Social networks:            http://www.fb.com/blynkapp
 *                               http://twitter.com/blynk_app
 *
 * Blynk library is licensed under MIT license
 * This example code is in public domain.
 *
 **************************************************************
 * This example shows how to use TI CC3200-LaunchXL
 * to connect your project to Blynk.
 *
 * Feel free to apply it to any other example. It's simple!
 *
 **************************************************************/

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

// Sensor objects
BMA222 mySensor;
Adafruit_TMP006 tmp006(0x41);

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

// Your WiFi credentials
char ssid[] = "YOUR SSID HERE";
char pass[] = "YOUR WIFI PASSWORD HERE";        // Set to "" for open networks
int dataX = 0;
int dataY = 0;
int dataZ = 0;

void setup()
{
  //Open a serial terminal with the PC
  Serial.begin(9600);   
  //Set up a blynk connection with your WiFi credentials
  Blynk.begin(auth, ssid, pass);  

  //Accel. setup
  mySensor.begin();
  
  //TMP006 setup
  tmp006.begin();
  
  //Setup RED LED to be an output
  pinMode(RED_LED, OUTPUT);
  digitalWrite(RED_LED, LOW);
}

// Virtual Pin 1 - Toggles the LED high or low depending on the mobile app input
BLYNK_WRITE(V1)
{
  //Print to the terminal
  BLYNK_LOG("Got a value: %s", param.asStr());
  
  //save teh value fromt he app to the variable i
  //if i=1, turn the LED on
  //if i=0, turn the LED off
  int i = param.asInt(); 
  if(i == 1)
  {
    digitalWrite(RED_LED, HIGH);
  }
  else if(i == 0)
  {
    digitalWrite(RED_LED, LOW);
  }
}

//Virtual pin 5 - Read the TMP006 value when called by the app
BLYNK_READ(5)
{
  float objt = tmp006.readObjTempC();
  Serial.print("Object Temperature: "); 
  Serial.print(objt); 
  Serial.println("*C");
  Blynk.virtualWrite(V5, (int)objt);
}

// Virtual Pin 6
// When virtual pin 6 is requested by the mobile app, we
// will also send data for pins 7 and 8 so all 3 graphs
// are updated
BLYNK_READ(6)
{
  //Send X axis data
  dataX = mySensor.readXData();
  Blynk.virtualWrite(V6,dataX);
  //Send Y axis data
  dataY = mySensor.readYData();
  Blynk.virtualWrite(V7,dataY);
  //Send Z axis data
  dataZ = mySensor.readZData();
  Blynk.virtualWrite(V8,dataZ);
}

// The main loop listens for commands from the mobile app
void loop()
{
  Blynk.run();
}

Credits

As4lz5rp
Daniel Oglvie

Launchpad Engineer at Texas Instruments

Contact

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

E-Ink Display based Static Desktop eCalendar
Easy
  • 8
  • 2

Full instructions

An electronic Desktop Calendar based on Electronic Ink Display controlled by TM4C123 Tiva(ARM) development board & programmed in Energia IDE

MSP432 Fun with IoT Workshop 2016
Easy
  • 3,536
  • 69

Full instructions

Explore the Educational BoosterPack paired with the MSP432 LaunchPad and then take that to the cloud with the CC3100 Wi-Fi BoosterPack!

MIT IAP 2016 Lab
Easy
  • 2,021
  • 47

A collection of the 6 labs for the MIT IAP Texas Instruments LaunchPad Workshop

Texas Instruments MSP-EXP432 - MultiTasking
Easy
  • 708
  • 20

Protip

MultiTasking ultrasonic and color sensor with Texas Instruments MSP-EXP432 and Energia.

Mongoose Embedded Networking Library on mbed+CC3100
Easy
  • 651
  • 12

Protip

Mongoose, the most popular open source embedded web server and networking library now supports the mbed platform. See CC3100 example.

Moisture Sensing LED Gauge
Easy
  • 770
  • 13

This demo uses a moisture sensor and LEDs to show the level of moisture in a variety of places.

Add projectSign up / Login