![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
A simple project for sending button input up to AT&T Flow
Dependencies: FXOS8700CQ MODSERIAL mbed
For instructions on using this program, see the AT&T Starter Kit tutorial on it.
Diff: main.cpp
- Revision:
- 55:3abf9e3f42e6
- Parent:
- 53:dcccf2881fa0
- Child:
- 56:cb42ff383dab
--- a/main.cpp Wed Jul 27 01:58:25 2016 +0000 +++ b/main.cpp Thu Jul 28 15:52:37 2016 +0000 @@ -1,4 +1,4 @@ - #include "mbed.h" +#include "mbed.h" #include <cctype> #include <string> #include "SerialBuffered.h" @@ -284,7 +284,15 @@ .UVindex = "0", .Proximity = "0", .Temperature_Si7020 = "0", - .Humidity_Si7020 = "0" + .Humidity_Si7020 = "0", + .Virtual_Sensor1 = "0", + .Virtual_Sensor2 = "0", + .Virtual_Sensor3 = "0", + .Virtual_Sensor4 = "0", + .Virtual_Sensor5 = "0", + .Virtual_Sensor6 = "0", + .Virtual_Sensor7 = "0", + .Virtual_Sensor8 = "0" }; void GenerateModemString(char * modem_string) @@ -306,6 +314,11 @@ sprintf(modem_string, "GET %s%s?serial=%s&temp=%s&humidity=%s&accelX=%s&accelY=%s&accelZ=%s&proximity=%s&light_uv=%s&light_vis=%s&light_ir=%s %s%s\r\n\r\n", FLOW_BASE_URL, FLOW_INPUT_NAME, FLOW_DEVICE_NAME, SENSOR_DATA.Temperature, SENSOR_DATA.Humidity, SENSOR_DATA.AccelX,SENSOR_DATA.AccelY,SENSOR_DATA.AccelZ, SENSOR_DATA.Proximity, SENSOR_DATA.UVindex, SENSOR_DATA.AmbientLightVis, SENSOR_DATA.AmbientLightIr, FLOW_URL_TYPE, MY_SERVER_URL); break; } + case TEMP_HUMIDITY_ACCELEROMETER_PMODSENSORS_VIRTUALSENSORS: + { + sprintf(modem_string, "GET %s%s?serial=%s&temp=%s&humidity=%s&accelX=%s&accelY=%s&accelZ=%s&proximity=%s&light_uv=%s&light_vis=%s&light_ir=%s&virt_sens1=%s&virt_sens2=%s&virt_sens3=%s&virt_sens4=%s&virt_sens5=%s&virt_sens6=%s&virt_sens7=%s&virt_sens8=%s %s%s\r\n\r\n", FLOW_BASE_URL, FLOW_INPUT_NAME, FLOW_DEVICE_NAME, SENSOR_DATA.Temperature, SENSOR_DATA.Humidity, SENSOR_DATA.AccelX,SENSOR_DATA.AccelY,SENSOR_DATA.AccelZ, SENSOR_DATA.Proximity, SENSOR_DATA.UVindex, SENSOR_DATA.AmbientLightVis, SENSOR_DATA.AmbientLightIr, SENSOR_DATA.Virtual_Sensor1, SENSOR_DATA.Virtual_Sensor2, SENSOR_DATA.Virtual_Sensor3, SENSOR_DATA.Virtual_Sensor4, SENSOR_DATA.Virtual_Sensor5, SENSOR_DATA.Virtual_Sensor6, SENSOR_DATA.Virtual_Sensor7, SENSOR_DATA.Virtual_Sensor8, FLOW_URL_TYPE, MY_SERVER_URL); + break; + } default: { sprintf(modem_string, "Invalid sensor selected\r\n\r\n"); @@ -496,6 +509,9 @@ // Send and receive data perpetually while(1) { static unsigned ledOnce = 0; + #ifdef USE_VIRTUAL_SENSORS + ProcessUsbInterface(); + #endif if (bTimerExpiredFlag) { bTimerExpiredFlag = false;