Lab3_Surveillance

Dependencies:   GPS mbed

Files at this revision

API Documentation at this revision

Comitter:
gtg846r
Date:
Thu Oct 13 17:42:27 2011 +0000
Parent:
1:65200fe545a5
Commit message:
Revision #3...Includes phone number input

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Oct 13 16:44:37 2011 +0000
+++ b/main.cpp	Thu Oct 13 17:42:27 2011 +0000
@@ -25,6 +25,7 @@
 
  float reading; 
  int alert_num = 0;
+ char phone_num[11];
 
 typedef struct work {
     FILE *fp;
@@ -152,7 +153,7 @@
     while (1) 
     {
             //pc.printf("message sent");
-            gsm.printf("AT+CMGS=\"16784370074\"\r\n");   //AT+CMGS=”<da>"...da - destination address
+            gsm.printf("AT+CMGS=\"%s\"\r\n", phone_num);   //AT+CMGS=”<da>"...da - destination address
           //  gsm.scanf("%s",buf);  //Response OK
            // gsm.scanf("%s",buf1);
             //pc.printf("%s\n",buf);
@@ -222,6 +223,8 @@
     { 
         pc.printf("Initialize Security System (y/n) \n");
         pc.scanf("%s", user_input);
+        pc.printf("Input phone number to send alerts\n");
+        pc.scanf("%s", phone_num);
      }
      pc.printf("Initializing...\n");
      init_cam();
@@ -255,7 +258,7 @@
         
         ++i;
         pc.printf("Motion value: %f\n", reading);
-        wait(.5);
+        wait(.4);
     }
  
     return 0;