Este es una programa para la transferencia de archivos entre la 2 sistemas embeded

Dependencies:   mbed

https://os.mbed.com/media/uploads/javierdavid2006/f084236d-f318-4560-8f2c-ad359a3940ad.jpg https://os.mbed.com/media/uploads/javierdavid2006/be47402f-b641-449b-bb02-1125b19db3f8.jpg https://os.mbed.com/media/uploads/javierdavid2006/009696aa-0612-41b1-ac80-ad8b4b370af7.jpg https://os.mbed.com/media/uploads/javierdavid2006/2759b22c-fe7b-449e-b3c8-567f08c87794.jpg

Revision:
2:5871ac93eab3
Parent:
1:99621cbfd365
diff -r 99621cbfd365 -r 5871ac93eab3 main.cpp
--- a/main.cpp	Wed Feb 05 15:54:32 2020 +0000
+++ b/main.cpp	Wed Feb 05 21:15:56 2020 +0000
@@ -1,28 +1,49 @@
 #include "mbed.h"
+
+//Configuracion pines Seriales
 Serial device(PA_2,PA_3);
 
+//Variables de Entrada y Salida
+DigitalOut myled_2(PD_13);//Led PD_13
+DigitalIn i(PA_0);//Pulsador PA
+DigitalIn o(PB_7);//Pulsador PB
+int b=0;
+
+//Funcion Principal
 int main()
 {
-    device.baud(19200);
-    wait(1);
-    
-    
-while(1) {
-device.printf( "AT \n\r" ); // en el comando para enviar sms 
-wait(1);
-device.printf( "AT + CMGF = 1 \n\r" ); // en el comando para enviar sms 
-wait_ms ( 100 );
+
+    device.baud(9600);//Velocidad de Comunicacion
+
+    while(1) {
+
+        if (i==1) {
+            device.printf( "ATD0998509325;" );//Numero de Telefono a llamar
+            device.putc(13);//Ascii de Cariage return
+
+            wait(10);
 
-wait_ms ( 100 );   
-device.printf( "AT + CMGS =" );
-//device.putc( '"' );
-device.printf( "0983322199" ); 
-//device.putc( '"' );
-device. printf ( "\n\r" );
-wait(1);
-device.printf( "Mensaje de ejemplo SMS \n\r" );
-wait(1);
-device.putc( 0x1A );
-wait(1);
-}
+            device.printf("ATH");//Colgar llamada
+            device.putc(13);//Codigo de Carriage Return
+            wait(2);
+            b=0;
+        }
+        if (o==1) {
+            wait(1);
+            device.printf("AT+CMGF=1\r");//Numero de Telefono a llamar
+            device.putc(13);//Ascii de Cariage return
+            wait(0.2);
+
+            device.printf("AT+CMGS=");
+            device.putc('"');
+            device.printf("+593998509325");
+            device.putc('"');
+            device.printf("\r");
+            device.putc(13);//Ascii de Cariage return
+            device.printf("Example Message SMS");
+            device.putc(0x1A);
+            wait(5);
+
+        }
+    }
 }
\ No newline at end of file