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;
}
}
可以在 Platforms » ST Nucleo F030R8网页(http://mbed.org/platforms/ST-Nucleo-F030R8/)查到Nucleo STM32F0 预设的串口接脚如下:
SERIAL_TX=PA_2
SERIAL_RX=PA_3