
SIM800L works with AT command on CoolTerm.
Dependencies: mbed BufferedSerial SoftSerial
Revision 0:b98b6cf2edfe, committed 2020-01-31
- Comitter:
- kchhouk
- Date:
- Fri Jan 31 20:55:08 2020 +0000
- Commit message:
- SIM800L works, with AT command, CoolTerm.
Changed in this revision
diff -r 000000000000 -r b98b6cf2edfe BufferedSerial.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BufferedSerial.lib Fri Jan 31 20:55:08 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/sam_grove/code/BufferedSerial/#7e5e866edd3d
diff -r 000000000000 -r b98b6cf2edfe GSMTest1.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GSMTest1.cpp Fri Jan 31 20:55:08 2020 +0000 @@ -0,0 +1,56 @@ +#include "mbed.h" +#include "BufferedSerial.h" +#include <string> + +//Works with AT Command +Serial pc(USBTX, USBRX); +Serial SIM800L(P3_1, P3_0); +DigitalOut led1(LED1); +DigitalOut led2(LED2); + +char *phone = "\"17039739276\""; +//char str[2]; + +long GSMBAUD = 9600; +long PCBAUD = 9600; + +int main(){ + pc.baud(PCBAUD); + SIM800L.baud(GSMBAUD); +/* + SIM800L.puts("AT"); + SIM800L.puts("\r\n"); + //wait(0.1f); + + SIM800L.puts("AT+CMGF=1"); + SIM800L.puts("\r\n"); + //wait(0.1f); + + SIM800L.puts("AT+CMGS=\"17039739276\""); + SIM800L.puts("\r\n"); + //wait(0.1f); + + SIM800L.printf("Testing SMS from KC."); + //SIM800L.puts("\r\n"); + //wait(0.1f); + //wait_ms(500); +*/ + while(1){ + while(pc.readable()){ + SIM800L.putc(pc.getc()); + //SIM800L.printf("%c", SIM800L.putc(pc.getc())); + //SIM800L.puts("\r\n"); + } + wait(0.1f); + while(SIM800L.readable()){ + //pc.putc(SIM800L.getc()); + pc.printf("%c", pc.putc(SIM800L.getc())); + } + //wait(0.1f); + + + + } + + +} \ No newline at end of file
diff -r 000000000000 -r b98b6cf2edfe SoftSerial.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SoftSerial.lib Fri Jan 31 20:55:08 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/Sissors/code/SoftSerial/#a0029614de72
diff -r 000000000000 -r b98b6cf2edfe mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Jan 31 20:55:08 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file