The car is controlled by the PS2 controller and the temperature is sent on xively via the wifly.

Dependencies:   C12832_lcd WiflyInterface libxively mbed-rtos mbed LM75B MMA7660

Fork of IOT-Project-Wifly-Xively by Bhakti Kulkarni

Files at this revision

API Documentation at this revision

Comitter:
bhakti08
Date:
Mon Jun 09 22:53:04 2014 +0000
Parent:
6:9abfe16d39e0
Commit message:
Final

Changed in this revision

LM75B.lib Show annotated file Show diff for this revision Revisions of this file
MMA7660.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- /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
--- /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
--- 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");