to_send msg

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
hemanthagowda
Date:
Mon Apr 28 12:14:03 2014 +0000
Commit message:
gsm_message;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r fdee2188ee70 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Apr 28 12:14:03 2014 +0000
@@ -0,0 +1,68 @@
+#include "mbed.h"
+char  a=0x1A,e=0x22,c=0x0d;
+char num[] = "9740647273";
+DigitalOut myled(LED1);
+char *rec[];
+
+ int i;
+ char* txt;
+Serial GSM(p9, p10,txt);  // tx, rx
+Serial pc(USBTX,USBRX);
+
+////////////////////////////////////////////////////////////////////
+// fun() - it reads the sensor, writes to LCD and SD card and also senda the data on GSM
+////////////////////////////////////////////////////////////////////
+ /*
+int  main()
+{
+      
+    //    GSM.printf("AT+CMGS=%c%s%c\r\n",e,num,e);
+         GSM.printf("AT\r\n");
+         wait(5);
+       // GSM.printf("ATD9620129820;\r\n");
+       //pc.printf("9620129820;\r\n");
+        //wait(10);
+        //GSM.printf("ATH\n");
+        //GSM.printf("Moisture");
+        //GSM.printf("%c",a);
+        return 0;
+}*/
+ 
+int main()
+   {
+   
+   GSM.baud(9600);
+   pc.baud(9600);
+   GSM.printf("AT\r\n");
+   wait(2);
+   GSM.printf("AT+CMGF=1\r\n");
+   wait(2);
+   GSM.scanf("%d",&i);
+   while(1)
+   {
+      wait(3);
+      
+     
+   //GSM.printf("ATD9742920934;%c\n",c);
+   GSM.printf("AT+CMGS=%c%s%c\r\n",e,num,e);
+   wait(2);
+  // pc.printf("AT+CMGS=%c%s%c%c\n",e,num,e,c);
+   //pc.printf("ATD9538765141;%c\n",c);
+   GSM.printf("Moisture\n\r");
+   
+  // pc.printf("Moisture\n");
+   GSM.printf("%c",a);
+  // pc.printf("%c",a);*/
+ /* GSM.printf("AT+CMGR=28\r\n");
+  wait(2);
+ GSM.scanf("%s",txt);
+ if(*txt=='REC')
+    {
+      myled=1;
+    }
+   wait(1);
+   }
+    */
+   
+   }
+ }
\ No newline at end of file
diff -r 000000000000 -r fdee2188ee70 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Apr 28 12:14:03 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file