From 705e279bbaca58c7d9daa111387ffc8249a8be9f Mon Sep 17 00:00:00 2001 From: Brendan Haines Date: Tue, 1 Nov 2016 21:42:56 -0600 Subject: [PATCH] phone seems to work. places call to correct number. receiving calls untested --- Hohm_Phone.ino | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Hohm_Phone.ino b/Hohm_Phone.ino index 5407c7c..a0063bc 100644 --- a/Hohm_Phone.ino +++ b/Hohm_Phone.ino @@ -169,6 +169,7 @@ void loop() { } } } + if ( startDialtone ) { //fona.sendCheckReply( F("AT+STTONE=1,20,5000" ), F("OK") ); // Start tone startDialtone = false; @@ -186,7 +187,6 @@ void loop() { Serial.print(phoneNumber[i]); Serial.print(", "); } - Serial.println(); Serial.println(phoneNumberLength); #endif // Check for complete phone number (including +1 country code) @@ -195,6 +195,17 @@ void loop() { } } + // Clear stored phone number on press of end button + if ( !digitalRead(BUT_END) ) { + for ( int j = 0; j < phoneNumberLength; j++) { + phoneNumber[j] = 0; + } + phoneNumberLength = 0; +#ifdef USB_DEBUG + Serial.println( phoneNumberLength ); +#endif + } + #ifdef SLEEP // Autoshutdown if inactive for extended period // Typecast to long avoids "rollover" issues