mbed-dev + bluepill
Dependencies: mbed-STM32F103C8T6 mbed-dev
main.cpp@12:3ddf4333812e, 2016-09-17 (annotated)
- Committer:
- testato
- Date:
- Sat Sep 17 10:23:50 2016 +0000
- Revision:
- 12:3ddf4333812e
- Parent:
- 11:2cc880f72fc1
- Child:
- 13:2bfcb5dc142a
mbed+bluepill
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hudakz | 5:3c3ef17a17a6 | 1 | #include "stm32f103c8t6.h" |
hudakz | 0:ab218237069e | 2 | #include "mbed.h" |
hudakz | 8:f1432e9af6c8 | 3 | |
testato | 10:69c66b10784c | 4 | //Serial pc(PA_2, PA_3); |
testato | 12:3ddf4333812e | 5 | DigitalOut myled(PC_13); |
hudakz | 8:f1432e9af6c8 | 6 | |
testato | 11:2cc880f72fc1 | 7 | int main() |
testato | 11:2cc880f72fc1 | 8 | { |
testato | 12:3ddf4333812e | 9 | confSysClock(); //Configure system clock (72MHz HSE clock, 48MHz USB clock) |
testato | 11:2cc880f72fc1 | 10 | |
testato | 11:2cc880f72fc1 | 11 | while(1) |
testato | 11:2cc880f72fc1 | 12 | { |
hudakz | 5:3c3ef17a17a6 | 13 | // The on-board LED is connected, via a resistor, to +3.3V (not to GND). |
hudakz | 3:c6a589f444b9 | 14 | // So to turn the LED on or off we have to set it to 0 or 1 respectively |
hudakz | 7:accb2c83a007 | 15 | myled = 0; // turn the LED on |
testato | 10:69c66b10784c | 16 | wait_ms(100); // 200 ms |
hudakz | 7:accb2c83a007 | 17 | myled = 1; // turn the LED off |
testato | 10:69c66b10784c | 18 | wait_ms(100); // 1 sec |
testato | 10:69c66b10784c | 19 | //pc.printf("Blink\r\n"); |
hudakz | 0:ab218237069e | 20 | } |
hudakz | 0:ab218237069e | 21 | } |
hudakz | 8:f1432e9af6c8 | 22 |