Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years ago.
Set baudrate serial port
Did I do something wrong? I downloaded the code, but I'm not transmiting the message.
include the mbed library with this snippet
#include "mbed.h"
#include "mbed.h"
Serial device(p9,p10);
int main() {
device.baud(115200);
printf("Hello, faster world!");
}
1 Answer
9 years ago.
printf goes to standard out as default (the USB virtual COM port on most boards). If you want to send data to a different port you need to indicate which port to use.
#include "mbed.h"
Serial device(p9,p10);
int main() {
device.baud(115200);
device.printf("Hello, faster world!");
}