
this is a demo code for Seeed ARCH GPRS V2.0 to work with Xively
Dependencies: GPRSInterface USBDevice mbed libxively
Fork of Seeed_ARCH_GPRS_V2_Xively_HelloWorld by
Revision 1:95596d36119d, committed 2014-06-09
- Comitter:
- lawliet
- Date:
- Mon Jun 09 11:14:12 2014 +0000
- Parent:
- 0:8a01089092bd
- Child:
- 2:2c4b4a9c30ad
- Commit message:
- update GPRSInterface library
Changed in this revision
--- a/GPRSInterface.lib Mon Apr 28 13:03:47 2014 +0000 +++ b/GPRSInterface.lib Mon Jun 09 11:14:12 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/lawliet/code/GPRSInterface/#464ccda1ebcc +http://mbed.org/users/lawliet/code/GPRSInterface/#180feb3ebe62
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Seeed_ARCH_GPRS_V2_Xively_HelloWorld.lib Mon Jun 09 11:14:12 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/lawliet/code/Seeed_ARCH_GPRS_V2_Xively_HelloWorld/#8a01089092bd
--- a/main.cpp Mon Apr 28 13:03:47 2014 +0000 +++ b/main.cpp Mon Jun 09 11:14:12 2014 +0000 @@ -32,7 +32,7 @@ #define XI_FEED_ID 571464242 // set Xively Feed ID (numerical, no quoutes) #define XI_API_KEY "niUYuSJkjqyzPFwnWqpApm7lLNv8fInUD6ijAoRrikqKFWbg" // set Xively API key (double-quoted string) -AnalogIn soundSensor(P0_11); +AnalogIn soundSensor(P0_12); GPRSInterface gprs(PIN_TX,PIN_RX,115200,"cmnet",NULL,NULL); USBSerial pc(0x1f00, 0x2012, 0x0001, false); DigitalOut power(PIN_PWR); @@ -109,8 +109,9 @@ return -1; } while(1) { - xi_set_value_f32(current_sound, soundSensor.read()); - pc.printf("update!\n"); + float val = 100*soundSensor.read(); + pc.printf("val = %f\n",val); + xi_set_value_f32(current_sound, val); xi_feed_update( xi_context, &feed ); wait( 10 ); }