AT cfommand

main.cpp

Committer:
HarryKeane
Date:
2020-02-20
Revision:
0:428ce6fd8969

File content as of revision 0:428ce6fd8969:

#include "mbed.h"

 
Serial PC(USBTX, USBRX); //This is solelly for PC comms
Serial GSM(PD_5, PD_6); //This is solelly for PC comms



int main(){
    
    PC.baud(115200);
    GSM.baud(9600);
    
    wait_ms(500); 
    
    PC.printf("Test");  
  
   

        
    GSM.printf("AT");
    
        wait_ms(500);
        
        printf("start read\n\r");

         while(1) {
            
            if(GSM.readable()>0) {
                printf("start\r\n");
                PC.printf("%c",GSM.getc());
                printf("\r\nStop\r\n");
            }
            
        
         }
}