aboutsummaryrefslogtreecommitdiff
path: root/libraries/Bridge/examples/Temboo/SendAnSMS/SendAnSMS.ino
diff options
context:
space:
mode:
authorFederico Fissore <f.fissore@arduino.cc>2013-07-15 15:22:50 +0200
committerFederico Fissore <f.fissore@arduino.cc>2013-07-15 15:22:50 +0200
commitbeb9e08b79d5c59957c1532e50da30cccc318cac (patch)
tree7bcc2a5440c4ce7b7017174b27bb95f1e174de83 /libraries/Bridge/examples/Temboo/SendAnSMS/SendAnSMS.ino
parent5836db3ddb6fa757169aede51395b7e39669ff4c (diff)
updated temboo examples (added ControlBySMS)
Diffstat (limited to 'libraries/Bridge/examples/Temboo/SendAnSMS/SendAnSMS.ino')
-rw-r--r--libraries/Bridge/examples/Temboo/SendAnSMS/SendAnSMS.ino13
1 files changed, 6 insertions, 7 deletions
diff --git a/libraries/Bridge/examples/Temboo/SendAnSMS/SendAnSMS.ino b/libraries/Bridge/examples/Temboo/SendAnSMS/SendAnSMS.ino
index 04c827e..2b0cfb1 100644
--- a/libraries/Bridge/examples/Temboo/SendAnSMS/SendAnSMS.ino
+++ b/libraries/Bridge/examples/Temboo/SendAnSMS/SendAnSMS.ino
@@ -54,7 +54,8 @@ const String TWILIO_NUMBER = "xxxxxxxxxx";
// the number to which the SMS should be sent, e.g., "+1 555-222-1212"
const String RECIPIENT_NUMBER = "xxxxxxxxxx";
-boolean success = false; // a flag to indicate whether we've sent the SMS yet or not
+// a flag to indicate whether we've attempted to send the SMS yet or not
+boolean attempted = false;
void setup() {
Serial.begin(9600);
@@ -69,7 +70,7 @@ void setup() {
void loop()
{
// only try to send the SMS if we haven't already sent it successfully
- if (!success) {
+ if (!attempted) {
Serial.println("Running SendAnSMS...");
@@ -116,7 +117,6 @@ void loop()
// a return code of zero (0) means everything worked
if (returnCode == 0) {
Serial.println("Success! SMS sent!");
- success = true;
} else {
// a non-zero return code means there was an error
// read and print the error message
@@ -126,10 +126,9 @@ void loop()
}
}
SendSMSChoreo.close();
-
- // do nothing for the next 60 seconds
- Serial.println("Waiting...");
- delay(60000);
+
+ // set the flag indicatine we've tried once.
+ attempted=true;
}
}