
Práctica desarrollada para pruebas con puerto SERIAL
Revision 0:77bea86887eb, committed 2020-02-01
- Comitter:
- flozada
- Date:
- Sat Feb 01 18:13:47 2020 +0000
- Commit message:
- SERIAL
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Feb 01 18:13:47 2020 +0000 @@ -0,0 +1,43 @@ +#include "mbed.h" + +DigitalOut myled(PD_15); +Serial device(PA_2,PA_3); + +int i; + +int main() +{ + i=1; + while(i<=256) + { + + device.baud(115200); + device.printf("%d\r", i); + device.printf("\n"); + wait(0.2); //led apagado 200ms + i++; + } + + i=1; + while(i<=256) + { + + device.baud(115200); + device.printf("%c\r", i); + device.printf("\n"); + wait(0.2); //led apagado 200ms + i++; + } + + i=1; + while(i<=256) + { + + device.baud(115200); + device.printf("%x\r", i); + device.printf("\n"); + wait(0.2); //led apagado 200ms + i++; + } +} +//crear a una variable q se imprima por p serial del 1 al 256, ASCII, HEX_ \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Feb 01 18:13:47 2020 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file