gsm1

Dependencies:   TextLCD mbed

Fork of GSM by gowrishankar N J

Committer:
HarishMekali
Date:
Tue May 07 13:45:44 2013 +0000
Revision:
0:2a5254679d16
Child:
1:641050920d1e
GSM

Who changed what in which revision?

UserRevisionLine numberNew contents of line
HarishMekali 0:2a5254679d16 1 #include "mbed.h"
HarishMekali 0:2a5254679d16 2 char a=0x1A,e=0x22,c=0x0d;
HarishMekali 0:2a5254679d16 3 char num[] = "9742920934";
HarishMekali 0:2a5254679d16 4
HarishMekali 0:2a5254679d16 5 Serial GSM(p9, p10); // tx, rx
HarishMekali 0:2a5254679d16 6 Serial pc(USBTX,USBRX);
HarishMekali 0:2a5254679d16 7
HarishMekali 0:2a5254679d16 8 ////////////////////////////////////////////////////////////////////
HarishMekali 0:2a5254679d16 9 // fun() - it reads the sensor, writes to LCD and SD card and also senda the data on GSM
HarishMekali 0:2a5254679d16 10 ////////////////////////////////////////////////////////////////////
HarishMekali 0:2a5254679d16 11
HarishMekali 0:2a5254679d16 12 /*void fun()
HarishMekali 0:2a5254679d16 13 {
HarishMekali 0:2a5254679d16 14
HarishMekali 0:2a5254679d16 15 //GSM.printf("AT+CMGS=%c%s%c\r\n",e,num,e);
HarishMekali 0:2a5254679d16 16 // GSM.printf("ATD9538765141;\n");
HarishMekali 0:2a5254679d16 17 // pc.printf("ATD9538765141;\n");
HarishMekali 0:2a5254679d16 18 //wait(3);
HarishMekali 0:2a5254679d16 19 //GSM.printf("Moisture");
HarishMekali 0:2a5254679d16 20 //GSM.printf("%c",a);
HarishMekali 0:2a5254679d16 21 return ;
HarishMekali 0:2a5254679d16 22 }*/
HarishMekali 0:2a5254679d16 23
HarishMekali 0:2a5254679d16 24 int main()
HarishMekali 0:2a5254679d16 25 {
HarishMekali 0:2a5254679d16 26
HarishMekali 0:2a5254679d16 27 GSM.baud(9600);
HarishMekali 0:2a5254679d16 28 pc.baud(9600);
HarishMekali 0:2a5254679d16 29 GSM.printf("AT\r\n");
HarishMekali 0:2a5254679d16 30 GSM.printf("AT+CMGF+1\r\n");
HarishMekali 0:2a5254679d16 31 while(1)
HarishMekali 0:2a5254679d16 32 {
HarishMekali 0:2a5254679d16 33 wait(3);
HarishMekali 0:2a5254679d16 34
HarishMekali 0:2a5254679d16 35 //GSM.printf("ATD9742920934;%c\n",c);
HarishMekali 0:2a5254679d16 36 GSM.printf("AT+CMGS=%c%s%c\r\n",e,num,e);
HarishMekali 0:2a5254679d16 37 // pc.printf("AT+CMGS=%c%s%c%c\n",e,num,e,c);
HarishMekali 0:2a5254679d16 38 //pc.printf("ATD9538765141;%c\n",c);
HarishMekali 0:2a5254679d16 39 GSM.printf("Moisture\n\r");
HarishMekali 0:2a5254679d16 40 // pc.printf("Moisture\n");
HarishMekali 0:2a5254679d16 41 GSM.printf("%c",a);
HarishMekali 0:2a5254679d16 42 // pc.printf("%c",a);
HarishMekali 0:2a5254679d16 43
HarishMekali 0:2a5254679d16 44 wait(1);
HarishMekali 0:2a5254679d16 45 }
HarishMekali 0:2a5254679d16 46
HarishMekali 0:2a5254679d16 47
HarishMekali 0:2a5254679d16 48 }
HarishMekali 0:2a5254679d16 49
HarishMekali 0:2a5254679d16 50
HarishMekali 0:2a5254679d16 51