Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
main.cpp@3:c0f6dcd350a8, 2016-09-09 (annotated)
- Committer:
- fpapayannis
- Date:
- Fri Sep 09 23:54:26 2016 +0000
- Revision:
- 3:c0f6dcd350a8
- Parent:
- 2:ba95dcca2d90
- Child:
- 4:e3357adeab6c
Escribo un car?cter en el puerto y lo recibo a la fuerza.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| bcostm | 0:028fac66239d | 1 | #include "mbed.h" |
| fpapayannis | 2:ba95dcca2d90 | 2 | #include "Serial.h" |
| bcostm | 1:e9d1c42a73ae | 3 | //------------------------------------ |
| bcostm | 1:e9d1c42a73ae | 4 | // Hyperterminal configuration |
| bcostm | 1:e9d1c42a73ae | 5 | // 9600 bauds, 8-bit data, no parity |
| bcostm | 1:e9d1c42a73ae | 6 | //------------------------------------ |
| bcostm | 1:e9d1c42a73ae | 7 | |
| fpapayannis | 2:ba95dcca2d90 | 8 | #define SERIAL_TX P0_10 |
| fpapayannis | 2:ba95dcca2d90 | 9 | #define SERIAL_RX P0_11 |
| fpapayannis | 2:ba95dcca2d90 | 10 | #define LEDStick P0_22 |
| fpapayannis | 2:ba95dcca2d90 | 11 | |
| bcostm | 0:028fac66239d | 12 | Serial pc(SERIAL_TX, SERIAL_RX); |
| bcostm | 0:028fac66239d | 13 | |
| fpapayannis | 2:ba95dcca2d90 | 14 | DigitalOut myled(LEDStick); |
| bcostm | 0:028fac66239d | 15 | |
| bcostm | 0:028fac66239d | 16 | int main() { |
| bcostm | 0:028fac66239d | 17 | int i = 1; |
| fpapayannis | 3:c0f6dcd350a8 | 18 | char caracter='A'; |
| fpapayannis | 2:ba95dcca2d90 | 19 | pc.baud(9600); |
| fpapayannis | 2:ba95dcca2d90 | 20 | pc.format(8,Serial::None,1); |
| bcostm | 0:028fac66239d | 21 | pc.printf("Hello World !\n"); |
| bcostm | 0:028fac66239d | 22 | while(1) { |
| bcostm | 0:028fac66239d | 23 | wait(1); |
| fpapayannis | 3:c0f6dcd350a8 | 24 | caracter=pc.getc(); |
| fpapayannis | 3:c0f6dcd350a8 | 25 | wait(1); |
| fpapayannis | 3:c0f6dcd350a8 | 26 | pc.putc(caracter); |
| fpapayannis | 3:c0f6dcd350a8 | 27 | //pc.printf("This program runs since %d seconds.\n", i++); |
| bcostm | 0:028fac66239d | 28 | myled = !myled; |
| bcostm | 0:028fac66239d | 29 | } |
| bcostm | 0:028fac66239d | 30 | } |
| bcostm | 0:028fac66239d | 31 |