![](/media/cache/profiles/7c39a5f991bef4a1e34187677a65871d.jpg.50x50_q85.jpg)
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@1:60fefa7f384b, 2021-01-30 (annotated)
- Committer:
- hudakz
- Date:
- Sat Jan 30 11:20:01 2021 +0000
- Revision:
- 1:60fefa7f384b
- Parent:
- 0:2912fe6f7530
- Child:
- 2:9625237e90fa
Using USBSerial on BLACKPILL board.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hudakz | 0:2912fe6f7530 | 1 | #include "mbed.h" |
hudakz | 0:2912fe6f7530 | 2 | #include "USBSerial.h" |
hudakz | 0:2912fe6f7530 | 3 | |
hudakz | 0:2912fe6f7530 | 4 | DigitalOut led1(LED1); |
hudakz | 0:2912fe6f7530 | 5 | USBSerial usbSerial; // connection is not blocked when USB is not plugged in |
hudakz | 0:2912fe6f7530 | 6 | |
hudakz | 0:2912fe6f7530 | 7 | /** |
hudakz | 0:2912fe6f7530 | 8 | * @brief |
hudakz | 0:2912fe6f7530 | 9 | * @note |
hudakz | 0:2912fe6f7530 | 10 | * @param |
hudakz | 0:2912fe6f7530 | 11 | * @retval |
hudakz | 0:2912fe6f7530 | 12 | */ |
hudakz | 0:2912fe6f7530 | 13 | int main() |
hudakz | 0:2912fe6f7530 | 14 | { |
hudakz | 0:2912fe6f7530 | 15 | printf("Starting ...\r\n"); |
hudakz | 0:2912fe6f7530 | 16 | led1 = 1; // off |
hudakz | 0:2912fe6f7530 | 17 | while (true) { |
hudakz | 0:2912fe6f7530 | 18 | led1 = 0; // on |
hudakz | 0:2912fe6f7530 | 19 | ThisThread::sleep_for(50); |
hudakz | 0:2912fe6f7530 | 20 | led1 = 1; // off |
hudakz | 0:2912fe6f7530 | 21 | ThisThread::sleep_for(1000); |
hudakz | 0:2912fe6f7530 | 22 | printf("Blink\r\n"); |
hudakz | 0:2912fe6f7530 | 23 | usbSerial.printf("I am a USB serial port\r\n"); // 12 Mbit/s (USB full-speed) |
hudakz | 0:2912fe6f7530 | 24 | } |
hudakz | 0:2912fe6f7530 | 25 | } |