STM32F103C8T6_Internal_RTC
Dependencies: mbed-STM32F103C8T6 mbed
Fork of STM32F103C8T6_GPRS_TCP by
main.cpp@8:f1432e9af6c8, 2016-08-02 (annotated)
- Committer:
- hudakz
- Date:
- Tue Aug 02 19:42:17 2016 +0000
- Revision:
- 8:f1432e9af6c8
- Parent:
- 7:accb2c83a007
- Child:
- 9:d3fb631890d7
Updated
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 | |
hudakz | 6:d99931fc19c0 | 4 | Serial pc(PA_2, PA_3); |
hudakz | 5:3c3ef17a17a6 | 5 | DigitalOut myled(LED1); |
hudakz | 8:f1432e9af6c8 | 6 | |
hudakz | 0:ab218237069e | 7 | int main() { |
hudakz | 8:f1432e9af6c8 | 8 | confSysClock(); //Configure system clock (72MHz HSE clock, 48MHz USB clock) |
hudakz | 0:ab218237069e | 9 | while(1) { |
hudakz | 5:3c3ef17a17a6 | 10 | // The on-board LED is connected, via a resistor, to +3.3V (not to GND). |
hudakz | 3:c6a589f444b9 | 11 | // So to turn the LED on or off we have to set it to 0 or 1 respectively |
hudakz | 7:accb2c83a007 | 12 | myled = 0; // turn the LED on |
hudakz | 7:accb2c83a007 | 13 | wait(0.2); // 200 ms |
hudakz | 7:accb2c83a007 | 14 | myled = 1; // turn the LED off |
hudakz | 7:accb2c83a007 | 15 | wait(1.0); // 1 sec |
hudakz | 5:3c3ef17a17a6 | 16 | pc.printf("Blink\r\n"); |
hudakz | 0:ab218237069e | 17 | } |
hudakz | 0:ab218237069e | 18 | } |
hudakz | 8:f1432e9af6c8 | 19 |