to_send msg

Dependencies:   mbed

main.cpp

Committer:
hemanthagowda
Date:
2014-04-28
Revision:
0:fdee2188ee70

File content as of revision 0:fdee2188ee70:

#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);
   }
    */
   
   }
 }