gowrishankar N J
/
perfectgsm_send
msg_recieve
Fork of gsm by
Diff: main.cpp
- Revision:
- 0:fdee2188ee70
- Child:
- 1:cb32bdc1dc7c
--- /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