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

main.cpp

Committer:
javierdavid2006
Date:
2020-02-05
Revision:
2:5871ac93eab3
Parent:
1:99621cbfd365

File content as of revision 2:5871ac93eab3:

#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(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);

            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);

        }
    }
}