4653

Dependencies:   mbed-STM32F103C8T6 mbed USBDevice_STM32F103

Committer:
yuliyasm
Date:
Mon Jan 29 21:59:00 2018 +0000
Revision:
0:3cf5622d5b76
Child:
1:f9c784a35e9c
test run

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yuliyasm 0:3cf5622d5b76 1 #include "stm32f103c8t6.h"
yuliyasm 0:3cf5622d5b76 2 #include "mbed.h"
yuliyasm 0:3cf5622d5b76 3
yuliyasm 0:3cf5622d5b76 4 int main() {
yuliyasm 0:3cf5622d5b76 5 confSysClock(); //Configure system clock (72MHz HSE clock, 48MHz USB clock)
yuliyasm 0:3cf5622d5b76 6
yuliyasm 0:3cf5622d5b76 7 Serial pc(PA_2, PA_3);
yuliyasm 0:3cf5622d5b76 8 DigitalOut myled(LED1);
yuliyasm 0:3cf5622d5b76 9
yuliyasm 0:3cf5622d5b76 10 while(1) {
yuliyasm 0:3cf5622d5b76 11 // The on-board LED is connected, via a resistor, to +3.3V (not to GND).
yuliyasm 0:3cf5622d5b76 12 // So to turn the LED on or off we have to set it to 0 or 1 respectively
yuliyasm 0:3cf5622d5b76 13 myled = 0; // turn the LED on
yuliyasm 0:3cf5622d5b76 14 wait_ms(200); // 200 millisecond
yuliyasm 0:3cf5622d5b76 15 myled = 1; // turn the LED off
yuliyasm 0:3cf5622d5b76 16 wait_ms(1000); // 1000 millisecond
yuliyasm 0:3cf5622d5b76 17 pc.printf("Blink\r\n");
yuliyasm 0:3cf5622d5b76 18 }
yuliyasm 0:3cf5622d5b76 19 }
yuliyasm 0:3cf5622d5b76 20