Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: C12832_lcd WiflyInterface libxively mbed-rtos mbed LM75B MMA7660
Fork of IOT-Project-Wifly-Xively by
Revision 7:c7023f76310e, committed 2014-06-09
- Comitter:
- bhakti08
- Date:
- Mon Jun 09 22:53:04 2014 +0000
- Parent:
- 6:9abfe16d39e0
- Commit message:
- Final
Changed in this revision
diff -r 9abfe16d39e0 -r c7023f76310e LM75B.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LM75B.lib Mon Jun 09 22:53:04 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/chris/code/LM75B/#6a70c9303bbe
diff -r 9abfe16d39e0 -r c7023f76310e MMA7660.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MMA7660.lib Mon Jun 09 22:53:04 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/Sissors/code/MMA7660/#a8e20db7901e
diff -r 9abfe16d39e0 -r c7023f76310e main.cpp --- a/main.cpp Mon Jun 09 12:18:36 2014 +0000 +++ b/main.cpp Mon Jun 09 22:53:04 2014 +0000 @@ -6,8 +6,8 @@ #include "MMA7660.h" #include "rtos.h" -#define XI_FEED_ID 209829319 // set Xively Feed ID (numerical, no quoutes) -#define XI_API_KEY "T0izYrB6TZVkmhhEWpzs5L7F5wqpJixxc6MtenkLDg3BLMIu" // set Xively API key (double-quoted string) +#define XI_FEED_ID 1344466483 // set Xively Feed ID (numerical, no quoutes) +#define XI_API_KEY "mgjx3VwlsvsMBhekqcASRLnzMPHi9Aw2gZCZCzyH0vQkefn3" // set Xively API key (double-quoted string) #include "xively.h" #include "xi_err.h" @@ -45,13 +45,28 @@ memset( &feed, NULL, sizeof( xi_feed_t ) ); feed.feed_id = XI_FEED_ID; - feed.datastream_count = 1; + feed.datastream_count = 4; feed.datastreams[0].datapoint_count = 1; xi_datastream_t* temperature_datastream = &feed.datastreams[0]; strcpy( temperature_datastream->datastream_id, "Temperature" ); xi_datapoint_t* current_temperature = &temperature_datastream->datapoints[0]; + feed.datastreams[1].datapoint_count = 1; + xi_datastream_t* x_axis_datastream = &feed.datastreams[1]; + strcpy( x_axis_datastream->datastream_id, "X_axis" ); + xi_datapoint_t* accel_x = &x_axis_datastream->datapoints[0]; + + feed.datastreams[2].datapoint_count = 1; + xi_datastream_t* y_axis_datastream = &feed.datastreams[2]; + strcpy( y_axis_datastream->datastream_id, "Y_axis" ); + xi_datapoint_t* accel_y = &y_axis_datastream->datapoints[0]; + + feed.datastreams[3].datapoint_count = 1; + xi_datastream_t* z_axis_datastream = &feed.datastreams[3]; + strcpy( z_axis_datastream->datastream_id, "Z_axis" ); + xi_datapoint_t* accel_z = &z_axis_datastream->datapoints[0]; + xi_context_t* xi_context = xi_create_context( XI_HTTP, XI_API_KEY, feed.feed_id ); if( xi_context == NULL ) @@ -63,6 +78,9 @@ while (true) { pc.printf("In xively thread\r\n"); xi_set_value_f32( current_temperature, temp.read() ); + xi_set_value_f32( accel_x ,axl.x() ); + xi_set_value_f32( accel_y ,axl.y() ); + xi_set_value_f32( accel_z ,axl.z() ); pc.printf("Value set\r\n"); xi_feed_update( xi_context, &feed ); pc.printf("Update\r\n");