MultiTech Dragonfly sending SMS sensor data from Freescale (NXP) MEMs board to cell phone
Dependencies: FXAS21002 FXOS8700 MbedJSONValue mbed mtsas
Fork of VVV_MultiTech_Dragonfly_ATT_Dallas by
Revision 9:3dcbe04adfd0, committed 2016-08-23
- Comitter:
- BlueShadow
- Date:
- Tue Aug 23 08:08:39 2016 +0000
- Parent:
- 8:a09dd040bb4b
- Commit message:
- MultiTech Dragonfly sending SMS sensor data from Freescale (NXP) MEMs board to cell phone
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r a09dd040bb4b -r 3dcbe04adfd0 main.cpp --- a/main.cpp Tue Aug 23 07:58:42 2016 +0000 +++ b/main.cpp Tue Aug 23 08:08:39 2016 +0000 @@ -21,11 +21,11 @@ // APN associated with SIM card // this APN should work for the AT&T SIM that came with your Dragonfly -static const std::string apn = "iot.aer.net"; +static const std::string apn = ""; // Phone number to send SMS messages to // just change the x digits - the 1 needs to stay! -static const std::string phone_number = "16122077184"; +static const std::string phone_number = " NEED A NUMBER with a 1"; FXOS8700 accel(D14,D15); FXOS8700 mag(D14,D15); @@ -118,16 +118,18 @@ MbedJSONValue sms_json; string sms_str; - sms_json["edge Gravity: "] = dataY; - sms_json[" front Gravity: "] = dataZ; + sms_json[" edge Gravity: "] = dataY; + sms_json[" level Gravity: "] = dataZ; sms_str = "SENSOR DATA:\n"; sms_str += sms_json.serialize(); logDebug("sending SMS to %s:\r\n%s", phone_number.c_str(), sms_str.c_str()); + if (dataZ<0.6f) { //added Code ret = radio->sendSMS(phone_number, sms_str); if (ret != MTS_SUCCESS) logError("sending SMS failed"); + } //added } } }