sergio burbano
/
chat_serial
Grupo 3 wilmer Pardo Sergio Burbano Daniel Paez
Revision 0:8cab7e1b82e8, committed 2017-09-23
- Comitter:
- grupo3
- Date:
- Sat Sep 23 21:37:18 2017 +0000
- Commit message:
- Chat
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SoftSerial.lib Sat Sep 23 21:37:18 2017 +0000 @@ -0,0 +1,1 @@ +http://os.mbed.com/users/Sissors/code/SoftSerial/#a0029614de72
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Sep 23 21:37:18 2017 +0000 @@ -0,0 +1,44 @@ +#include "mbed.h" +#include "SoftSerial.h" + +SoftSerial nucleo (D8,D9); +Serial pc(SERIAL_TX, SERIAL_RX); +char sent,rec; +int i =0; + +char msm[25]= {}; +int main() +{ + + + + while(1) { + + if (pc.readable()>0) { + sent=pc.getc(); + if(sent == 13) { + for (int j = 0; j<i; j++) { + nucleo.printf("%c",msm[j]); + pc.printf("%c",msm[j]); + wait(0.01); + } + nucleo.printf("\n\r"); + pc.printf("\n\r"); + + i=0; + } else { + msm[i]= sent; + i++; + } + } + if(nucleo.readable()>0) { + rec=nucleo.getc(); + pc.printf("%c",rec); + wait(0.01); + + + } + + } + } +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Sep 23 21:37:18 2017 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/mbed/builds/675da3299148 \ No newline at end of file