Benny Gómez
/
Serial_Shit_SLAVE
jajajaja
Revision 0:1bdfe2ebaecd, committed 2017-06-03
- Comitter:
- sick010203
- Date:
- Sat Jun 03 17:50:51 2017 +0000
- Commit message:
- Esclavo;
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SoftSerial.lib Sat Jun 03 17:50:51 2017 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/Sissors/code/SoftSerial/#a0029614de72
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Jun 03 17:50:51 2017 +0000 @@ -0,0 +1,36 @@ +#include "mbed.h" +#include "SoftSerial.h" +#include <string> +SoftSerial micro(D2,D3); +Serial pc (USBTX, USBRX); +DigitalOut bad(LED2); + + +int main () { +micro.baud(9600); +pc.baud(9600); + +string readString; +char message [125]; + + while (1) + { + while (micro.readable()>0) + { + wait(0.003); + //micro.gets(message,5); + micro.scanf("%s", message); + pc.printf("%s\r\n",message); + // readString += message; + //if (readString.length()>0) + //{ + // pc.printf("%s\r\n",readString); + //} + + readString=""; + break; + } + + } + + } \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Jun 03 17:50:51 2017 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/mbed/builds/4eea097334d6 \ No newline at end of file