![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Este es una programa para la transferencia de archivos entre la 2 sistemas embeded
Revision 2:5871ac93eab3, committed 2020-02-05
- Comitter:
- javierdavid2006
- Date:
- Wed Feb 05 21:15:56 2020 +0000
- Parent:
- 1:99621cbfd365
- Commit message:
- Proyecto donde se hace comunicacion celular para llamar y para escribir SMS:
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
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