Madhura Tapse
/
STM32_Serial_CAN
Example code
Diff: main.cpp
- Revision:
- 1:ce08f1d8140c
- Parent:
- 0:0ee4748f4c5c
- Child:
- 2:384c0e3bb7ab
--- a/main.cpp Fri Jul 07 06:52:15 2017 +0000 +++ b/main.cpp Sat Jul 08 05:01:19 2017 +0000 @@ -1,12 +1,24 @@ #include "mbed.h" -//------------------------------------------------------------------------------ -// Before using this example, ensure that you an hyperterminal installed on your -// computer. More info here: https://developer.mbed.org/handbook/Terminals -// -// Hyperterminal default configuration: -// 9600 bauds, 8-bit data, no parity -//------------------------------------------------------------------------------ +/*------------------------------------------------------------------------------ +Before to use this example, ensure that you an hyperterminal installed on your +computer. More info here: https://developer.mbed.org/handbook/Terminals + +The default serial comm port uses the SERIAL_TX and SERIAL_RX pins (see their +definition in the PinNames.h file). + +The default serial configuration in this case is 9600 bauds, 8-bit data, no parity + +If you want to change the baudrate for example, you have to redeclare the +serial object in your code: + +Serial pc(SERIAL_TX, SERIAL_RX); + +Then, you can modify the baudrate and print like this: + +pc.baud(115200); +pc.printf("Hello World !\n"); +------------------------------------------------------------------------------*/ DigitalOut led(LED1);