![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Nucleo serial comm input output details
main.cpp@0:30ef5d9ef234, 2015-04-20 (annotated)
- Committer:
- kumaresh
- Date:
- Mon Apr 20 10:32:26 2015 +0000
- Revision:
- 0:30ef5d9ef234
nucleo serial comm details
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kumaresh | 0:30ef5d9ef234 | 1 | #include "mbed.h" |
kumaresh | 0:30ef5d9ef234 | 2 | |
kumaresh | 0:30ef5d9ef234 | 3 | //------------------------------------ |
kumaresh | 0:30ef5d9ef234 | 4 | // Hyperterminal configuration |
kumaresh | 0:30ef5d9ef234 | 5 | // defau9600 bauds, 8-bit data, no parity |
kumaresh | 0:30ef5d9ef234 | 6 | |
kumaresh | 0:30ef5d9ef234 | 7 | //Arduino pin D0 & D1 is disconnected by default in nucleo board and hence serial O/P or I/P will not work. |
kumaresh | 0:30ef5d9ef234 | 8 | // REFER ST USER MANUAL UM 1724 |
kumaresh | 0:30ef5d9ef234 | 9 | |
kumaresh | 0:30ef5d9ef234 | 10 | //O/P/ or I/P will work in ST link(USB to serial comm) or can also be used from CN3 connector of nucleo board. |
kumaresh | 0:30ef5d9ef234 | 11 | //------------------------------------ |
kumaresh | 0:30ef5d9ef234 | 12 | |
kumaresh | 0:30ef5d9ef234 | 13 | Serial pc(SERIAL_TX, SERIAL_RX); |
kumaresh | 0:30ef5d9ef234 | 14 | |
kumaresh | 0:30ef5d9ef234 | 15 | DigitalOut myled(LED1); |
kumaresh | 0:30ef5d9ef234 | 16 | |
kumaresh | 0:30ef5d9ef234 | 17 | int main() { |
kumaresh | 0:30ef5d9ef234 | 18 | int i = 1; |
kumaresh | 0:30ef5d9ef234 | 19 | pc.printf("Hello World !\n"); |
kumaresh | 0:30ef5d9ef234 | 20 | while(1) { |
kumaresh | 0:30ef5d9ef234 | 21 | wait(0.8); |
kumaresh | 0:30ef5d9ef234 | 22 | pc.printf("This program runs since %d seconds.\n", i++); |
kumaresh | 0:30ef5d9ef234 | 23 | myled = !myled; |
kumaresh | 0:30ef5d9ef234 | 24 | } |
kumaresh | 0:30ef5d9ef234 | 25 | } |
kumaresh | 0:30ef5d9ef234 | 26 |