Using USBSerial on BLACKPILL board.

For more details click on the link below:

Import programBlackpill_Hello

Using low cost Blackpill (STM32F411CEU6) boards with mbed.

main.cpp

Committer:
hudakz
Date:
2021-01-30
Revision:
0:2912fe6f7530
Child:
1:60fefa7f384b

File content as of revision 0:2912fe6f7530:

// Blinky demo for the STM32F407VET6 boards.
// See http://wiki.stm32duino.com/index.php?title=STM32F407.
//
// Use "Seed Arch Max" as target platform for the online compiler.
#include "mbed.h"
#include "USBSerial.h"

DigitalOut  led1(LED1);
USBSerial   usbSerial;  // connection is not blocked when USB is not plugged in

/**
 * @brief
 * @note
 * @param
 * @retval
 */
int main()
{
    printf("Starting ...\r\n");
    led1 = 1;                                           // off
    while (true) {
        led1 = 0;                                       // on
        ThisThread::sleep_for(50);
        led1 = 1;                                       // off
        ThisThread::sleep_for(1000);
        printf("Blink\r\n");
        usbSerial.printf("I am a USB serial port\r\n"); // 12 Mbit/s (USB full-speed)
    }
}