Close

CC3200 MCU LaunchPad Hardware.

A project log for Internet-of-things with CC3200 Dev Board

Internet-of-things with CC3200 development board or my new wireless Thingamajiggy.

romanRoman 03/22/2016 at 21:250 Comments

CC3200 Development Board has a lot of useful hardware.

The easiest way to start is to work with the two on-board sensors

accelerometer and temperature and then expand to new

sensors and other hardware.

TMP006 Infrared

Thermopile Sensor in Chip-Scale Package.


BMA222 3-AXIS ACCELEROMETER DIGITAL SMD

The following function deals with HTTP events. The source code can be downloaded from here. File name is ExositeCC3200CloudDemo-BETA-20140708.zip.

void SimpleLinkHttpServerCallback(SlHttpServerEvent_t *pSlHttpServerEvent, 
                                SlHttpServerResponse_t *pSlHttpServerResponse){
....
}

Two events are of a particular interest at this point.

Temperature read:

ptr = pSlHttpServerResponse->ResponseData.token_value.data;
pSlHttpServerResponse->ResponseData.token_value.len = 0;
if(memcmp(pSlHttpServerEvent->EventData.httpTokenName.data, 
GET_token_TEMP, strlen((const char *)GET_token_TEMP)) == 0)
{
float fCurrentTemp;
TMP006DrvGetTemp(&fCurrentTemp);
char cTemp = (char)fCurrentTemp;
short sTempLen = itoa(cTemp,(char*)ptr);
ptr[sTempLen++] = ' ';
ptr[sTempLen] = 'F';
pSlHttpServerResponse->ResponseData.token_value.len += sTempLen;
}
Accelerometer

read:

if(memcmp(pSlHttpServerEvent->EventData.httpTokenName.data, 
GET_token_ACC, strlen((const char *)GET_token_ACC)) == 0)
{

ReadAccSensor();
if(g_ucDryerRunning)
{
    strcpy((char*)pSlHttpServerResponse->ResponseData.token_value.data,"Running");
    pSlHttpServerResponse->ResponseData.token_value.len += strlen("Running");
        }
else
{
    strcpy((char*)pSlHttpServerResponse->ResponseData.token_value.data,"Stopped");
    pSlHttpServerResponse->ResponseData.token_value.len += strlen("Stopped");
}
}

Both sensors share I2C bus for command and data communications.



Discussions