![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
based on hudakz USBSerial example - blinks with capslock and onboard LED.
Dependencies: USBDevice_STM32F103 mbed-STM32F103C8T6 mbed
Fork of STM32F103C8T6_USBSerial by
main.cpp@0:0279e8c1f111, 2016-07-08 (annotated)
- Committer:
- hudakz
- Date:
- Fri Jul 08 21:19:45 2016 +0000
- Revision:
- 0:0279e8c1f111
- Child:
- 1:0e1269402efd
Initial revision
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hudakz | 0:0279e8c1f111 | 1 | #include "stm32f103c8t6.h" |
hudakz | 0:0279e8c1f111 | 2 | #include "mbed.h" |
hudakz | 0:0279e8c1f111 | 3 | #include "USBSerial.h" |
hudakz | 0:0279e8c1f111 | 4 | |
hudakz | 0:0279e8c1f111 | 5 | Serial pc(PA_2, PA_3); |
hudakz | 0:0279e8c1f111 | 6 | DigitalOut myled(LED1); |
hudakz | 0:0279e8c1f111 | 7 | |
hudakz | 0:0279e8c1f111 | 8 | int main() { |
hudakz | 0:0279e8c1f111 | 9 | confSysClock(48); // Configuring system clock for USB |
hudakz | 0:0279e8c1f111 | 10 | USBSerial usbSerial; |
hudakz | 0:0279e8c1f111 | 11 | |
hudakz | 0:0279e8c1f111 | 12 | pc.baud(9600); |
hudakz | 0:0279e8c1f111 | 13 | |
hudakz | 0:0279e8c1f111 | 14 | while(1) { |
hudakz | 0:0279e8c1f111 | 15 | myled = !myled; |
hudakz | 0:0279e8c1f111 | 16 | pc.printf("I am a serial port\r\n"); |
hudakz | 0:0279e8c1f111 | 17 | usbSerial.printf("I am an USB serial port\r\n"); |
hudakz | 0:0279e8c1f111 | 18 | wait_ms(1000); |
hudakz | 0:0279e8c1f111 | 19 | } |
hudakz | 0:0279e8c1f111 | 20 | } |
hudakz | 0:0279e8c1f111 | 21 |