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.
8 years, 9 months ago.
Serial.begin(9600); IN MBED
Is it possible to use Arduino like Serial.begin(9600); in mbed to allow Serial.println("abvd!"); for debugging?
1 Answer
8 years, 9 months ago.
Almost the same...This is the sample code "Nucelo_printf"
#include "mbed.h"
//------------------------------------
// Hyperterminal configuration
// 9600 bauds, 8-bit data, no parity
//------------------------------------
Serial pc(SERIAL_TX, SERIAL_RX);
DigitalOut myled(LED1);
int main()
{
int i = 1;
pc.printf("Hello World !\n");
while(1) {
wait(1);
pc.printf("This program runs since %d seconds.\n", i++);
myled = !myled;
}
}