![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Serial control with STM32 Nucleo
Diff: main.cpp
- Revision:
- 0:fde0aa5b370d
- Child:
- 1:457c0c664181
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Apr 29 09:23:17 2021 +0000 @@ -0,0 +1,28 @@ +/* mbed Microcontroller Library + * Copyright (c) 2019 ARM Limited + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "mbed.h" +#include "platform/mbed_thread.h" + + +// Blinking rate in milliseconds +#define BLINKING_RATE_MS 500 + +Serial pc(USBTX,USBRX); + +int main() +{ + // Initialise the digital pin LED1 as an output + DigitalOut led(LED1); + + pc.printf("Hello World !\r\n"); + pc.printf("Here I'm !\r\n"); + pc.printf("It works !\r\n"); + + while (true) { + led = !led; + thread_sleep_for(BLINKING_RATE_MS); + } +}