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
Diff: main.cpp
- Revision:
- 1:95596d36119d
- Parent:
- 0: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 ); }