AT_Command

Dependencies:   mbed Queue-AT

Files at this revision

API Documentation at this revision

Comitter:
williequesada
Date:
Tue Jun 04 19:34:45 2019 +0000
Commit message:
pablo

Changed in this revision

Queue.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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Queue.lib	Tue Jun 04 19:34:45 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/williequesada/code/Queue-AT/#a09b38fe65c9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Jun 04 19:34:45 2019 +0000
@@ -0,0 +1,44 @@
+#include "mbed.h"
+
+//------------------------------------
+// Hyperterminal configuration
+// 9600 bauds, 8-bit data, no parity
+//------------------------------------
+
+RawSerial   Computer(SERIAL_TX, SERIAL_RX,9600);      // tx, rx
+RawSerial   Gsm(PA_0,PA_1,19200);
+DigitalOut  led(LED2);
+DigitalOut  ResetSIM900(PA_10);
+DigitalOut  EnableSIM900(PB_0);
+char c;
+
+DigitalOut myled(LED1);
+
+void Interrupt_Sim900()
+{
+    if(Gsm.readable()) {
+        c=Gsm.getc();
+        Computer.putc(c);
+    }
+}
+
+void Interrupt_Computer()
+{
+       c=Computer.getc();
+       Gsm.putc(c);
+}
+
+int main()
+{
+    Gsm.attach(&Interrupt_Sim900);
+    Computer.attach(&Interrupt_Computer);
+    Computer.printf("Commmandos AT\n");
+    ResetSIM900=0;
+    EnableSIM900=1;
+    wait(1);
+    EnableSIM900=0;
+    while(1) {
+        wait(1);
+        led = !led;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Jun 04 19:34:45 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file