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:
- 1:60fefa7f384b
- Parent:
- 0:2912fe6f7530
- Child:
- 2:9625237e90fa
File content as of revision 1:60fefa7f384b:
#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) } }