Demo of the usage USBDevice library with Blue Pill STM32F103C8T6 board.

Dependencies:   USBDevice

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /**
00002  * The example of the program for STM32F103C8T6 (Blue Pill board).
00003  *
00004  * This program demonstrate led and usb serial port usage.
00005  *
00006  * @author Kochin Konstantin
00007  */
00008 #include "USBSerial.h"
00009 #include "mbed.h"
00010 #include "stdio.h"
00011 
00012 DigitalOut myled(LED1);
00013 USBSerial usbSerial(0x1f00, 0x2012, 0x0001, false);
00014 
00015 int main()
00016 {
00017     uint32_t counter = 0;
00018 
00019     while (true) {
00020         usbSerial.printf("I am a USB serial port. Tick %d.\n", counter);
00021         counter++;
00022 
00023         myled = !myled;
00024 
00025         wait_ms(1000);
00026     }
00027 }