gsm1

Dependencies:   TextLCD mbed

Fork of GSM by gowrishankar N J

Files at this revision

API Documentation at this revision

Comitter:
shirley
Date:
Mon May 05 14:35:06 2014 +0000
Parent:
1:641050920d1e
Commit message:
aaa

Changed in this revision

LCD.h Show annotated file Show diff for this revision Revisions of this file
TextLCD.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LCD.h	Mon May 05 14:35:06 2014 +0000
@@ -0,0 +1,8 @@
+// LCD.h file
+#ifndef LCD_H
+#define LCD_H
+#include "mbed.h"
+void display_to_LCD(char value); //function to display characters on the LCD
+void toggle_enable(void); //function to toggle the enable bit
+void LCD_init(void); //function to initialise the LCD
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Mon May 05 14:35:06 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mamezu/code/TextLCD/#ffeb3e6c1367
--- a/main.cpp	Fri May 02 07:42:34 2014 +0000
+++ b/main.cpp	Mon May 05 14:35:06 2014 +0000
@@ -1,6 +1,9 @@
 #include "mbed.h"
 #include "Serial.h"
+#include "TextLCD.h"
+#include "cstring"
 DigitalOut myled(LED1);
+TextLCD lcd(p19, p20, p21, p22, p23, p24);
 char  a=0x1A,e=0x22,c=0x0d;
 //char  a=0x1A,e=0x22,c=0x0d;
 //char num[] = "9740647273";
@@ -10,29 +13,75 @@
 
 Serial GSM(p9,p10);  // tx, rx
 Serial pc(USBTX,USBRX);
+void lcddisp(char *s);
 
 char sm[3]="SM";
 char all[4]="ALL";
-
-
+char *s;
+char *p='\0';
+int countSpace=0;
 
 int main()
 {
-   char  z[120];
-   int i=0;   
    GSM.baud(9600);
    pc.baud(9600);
-  GSM.printf("AT+CMGR=1\r\n");
+char  z[141];
+    int i=0;
+    
+   
+   
+    
+   
+  GSM.printf("AT+CMGR=1\r\r");
    //wait(2);
+   //lcd.printf("\n");
+   
    while(1)
+   
    {
-   while(!GSM.readable())
-   {}
+       while(!GSM.readable())
+       {};
+        
+   //do{
   // pc.printf("aaa");
+   
    GSM.scanf("%c",&z[i]);
    i++;
-   if(i==120)break;
-   }
-   pc.printf("%s",z);
+//   if(countSpace >= 13)
+//         break;
+//      if(z[i] == ' ')
+//        countSpace++;  
+//   }
+    
+lcd.printf("\n");
+if(i==141) break;
 }
+    for(i=82;i<141;i++)
+    {
+        wait(0.2);
+      lcd.printf("%c",z[i]);
+     
+    //lcd.printf("%s",);
+        wait(0.25);
+    }
+ 
+  //lcddisp(z);
+   
+   wait(10);
+   GSM.printf("AT+CMGD=1\r\n");
+  wait(2);
+ }  
+
+
+//void lcddisp(char *s)
+//{
+//    int l=strlen(s);
+//    for(int i=80;i<l;i++)
+//    {
+//        lcd.printf("%c",s[i]);
+//        wait(1);
+//    }
+//}
+        
+
    
\ No newline at end of file