Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of GSM by
Diff: main.cpp
- Revision:
- 0:2a5254679d16
- Child:
- 1:108ba02633f2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue May 07 13:45:44 2013 +0000 @@ -0,0 +1,51 @@ +#include "mbed.h" +char a=0x1A,e=0x22,c=0x0d; +char num[] = "9742920934"; + +Serial GSM(p9, p10); // tx, rx +Serial pc(USBTX,USBRX); + +//////////////////////////////////////////////////////////////////// +// fun() - it reads the sensor, writes to LCD and SD card and also senda the data on GSM +//////////////////////////////////////////////////////////////////// + +/*void fun() +{ + + //GSM.printf("AT+CMGS=%c%s%c\r\n",e,num,e); + // GSM.printf("ATD9538765141;\n"); + // pc.printf("ATD9538765141;\n"); + //wait(3); + //GSM.printf("Moisture"); + //GSM.printf("%c",a); + return ; +}*/ + +int main() + { + + GSM.baud(9600); + pc.baud(9600); + GSM.printf("AT\r\n"); + GSM.printf("AT+CMGF+1\r\n"); + while(1) + { + wait(3); + + //GSM.printf("ATD9742920934;%c\n",c); + GSM.printf("AT+CMGS=%c%s%c\r\n",e,num,e); + // 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); + + wait(1); + } + + + } + + +