gsm1

Dependencies:   TextLCD mbed

Fork of GSM by gowrishankar N J

Committer:
gowrishankarnj
Date:
Fri May 02 07:42:34 2014 +0000
Revision:
1:641050920d1e
Parent:
0:2a5254679d16
Child:
2:9a9fa2279b8e
gsm

Who changed what in which revision?

UserRevisionLine numberNew contents of line
HarishMekali 0:2a5254679d16 1 #include "mbed.h"
gowrishankarnj 1:641050920d1e 2 #include "Serial.h"
gowrishankarnj 1:641050920d1e 3 DigitalOut myled(LED1);
HarishMekali 0:2a5254679d16 4 char a=0x1A,e=0x22,c=0x0d;
gowrishankarnj 1:641050920d1e 5 //char a=0x1A,e=0x22,c=0x0d;
gowrishankarnj 1:641050920d1e 6 //char num[] = "9740647273";
gowrishankarnj 1:641050920d1e 7
HarishMekali 0:2a5254679d16 8
gowrishankarnj 1:641050920d1e 9 //char *txt;
gowrishankarnj 1:641050920d1e 10
gowrishankarnj 1:641050920d1e 11 Serial GSM(p9,p10); // tx, rx
HarishMekali 0:2a5254679d16 12 Serial pc(USBTX,USBRX);
HarishMekali 0:2a5254679d16 13
gowrishankarnj 1:641050920d1e 14 char sm[3]="SM";
gowrishankarnj 1:641050920d1e 15 char all[4]="ALL";
HarishMekali 0:2a5254679d16 16
HarishMekali 0:2a5254679d16 17
HarishMekali 0:2a5254679d16 18
gowrishankarnj 1:641050920d1e 19 int main()
gowrishankarnj 1:641050920d1e 20 {
gowrishankarnj 1:641050920d1e 21 char z[120];
gowrishankarnj 1:641050920d1e 22 int i=0;
gowrishankarnj 1:641050920d1e 23 GSM.baud(9600);
gowrishankarnj 1:641050920d1e 24 pc.baud(9600);
gowrishankarnj 1:641050920d1e 25 GSM.printf("AT+CMGR=1\r\n");
gowrishankarnj 1:641050920d1e 26 //wait(2);
gowrishankarnj 1:641050920d1e 27 while(1)
gowrishankarnj 1:641050920d1e 28 {
gowrishankarnj 1:641050920d1e 29 while(!GSM.readable())
gowrishankarnj 1:641050920d1e 30 {}
gowrishankarnj 1:641050920d1e 31 // pc.printf("aaa");
gowrishankarnj 1:641050920d1e 32 GSM.scanf("%c",&z[i]);
gowrishankarnj 1:641050920d1e 33 i++;
gowrishankarnj 1:641050920d1e 34 if(i==120)break;
gowrishankarnj 1:641050920d1e 35 }
gowrishankarnj 1:641050920d1e 36 pc.printf("%s",z);
gowrishankarnj 1:641050920d1e 37 }
gowrishankarnj 1:641050920d1e 38