STM32F103C8T6_Internal_RTC
Dependencies: mbed-STM32F103C8T6 mbed
Fork of STM32F103C8T6_GPRS_TCP by
main.cpp@13:bf9a5ca067bf, 2018-07-13 (annotated)
- Committer:
- shivanandgowdakr
- Date:
- Fri Jul 13 08:22:41 2018 +0000
- Revision:
- 13:bf9a5ca067bf
- Parent:
- 12:91de57777095
STM32F103C8T6 BLUE PILL Internal RTC ;
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" |
shivanandgowdakr | 13:bf9a5ca067bf | 3 | #include "Time.h" |
shivanandgowdakr | 13:bf9a5ca067bf | 4 | |
shivanandgowdakr | 12:91de57777095 | 5 | |
shivanandgowdakr | 13:bf9a5ca067bf | 6 | Serial pc(PA_2, PA_3); |
shivanandgowdakr | 13:bf9a5ca067bf | 7 | DigitalOut myled(LED1); |
shivanandgowdakr | 13:bf9a5ca067bf | 8 | |
shivanandgowdakr | 13:bf9a5ca067bf | 9 | |
shivanandgowdakr | 12:91de57777095 | 10 | int main() |
shivanandgowdakr | 12:91de57777095 | 11 | { |
shivanandgowdakr | 13:bf9a5ca067bf | 12 | confSysClock(); |
hudakz | 7:accb2c83a007 | 13 | myled = 0; // turn the LED on |
hudakz | 10:4b88be251088 | 14 | wait_ms(200); // 200 millisecond |
hudakz | 7:accb2c83a007 | 15 | myled = 1; // turn the LED off |
hudakz | 10:4b88be251088 | 16 | wait_ms(1000); // 1000 millisecond |
hudakz | 5:3c3ef17a17a6 | 17 | pc.printf("Blink\r\n"); |
shivanandgowdakr | 13:bf9a5ca067bf | 18 | char DATE[12]={'\0'}; |
shivanandgowdakr | 13:bf9a5ca067bf | 19 | char TIME[10]={'\0'}; |
shivanandgowdakr | 13:bf9a5ca067bf | 20 | |
shivanandgowdakr | 13:bf9a5ca067bf | 21 | int success=iSetTerminalTime("14072018101113"); |
shivanandgowdakr | 12:91de57777095 | 22 | |
shivanandgowdakr | 13:bf9a5ca067bf | 23 | if(success==0) |
shivanandgowdakr | 13:bf9a5ca067bf | 24 | pc.printf(" Time Set Successfull\r\n"); |
shivanandgowdakr | 13:bf9a5ca067bf | 25 | else |
shivanandgowdakr | 13:bf9a5ca067bf | 26 | pc.printf(" Unable to set terminal time \r\n"); |
shivanandgowdakr | 12:91de57777095 | 27 | |
shivanandgowdakr | 13:bf9a5ca067bf | 28 | while(success==0) |
shivanandgowdakr | 13:bf9a5ca067bf | 29 | { |
shivanandgowdakr | 13:bf9a5ca067bf | 30 | Get_Date_Time(DATE,TIME); |
shivanandgowdakr | 13:bf9a5ca067bf | 31 | pc.printf("Date : %s\r\n",DATE); |
shivanandgowdakr | 13:bf9a5ca067bf | 32 | pc.printf("Time : %s\r\n",TIME); |
shivanandgowdakr | 13:bf9a5ca067bf | 33 | } |
shivanandgowdakr | 13:bf9a5ca067bf | 34 | |
hudakz | 0:ab218237069e | 35 | } |
shivanandgowdakr | 12:91de57777095 | 36 | |
shivanandgowdakr | 12:91de57777095 | 37 | |
shivanandgowdakr | 12:91de57777095 | 38 | |
shivanandgowdakr | 12:91de57777095 | 39 | |
shivanandgowdakr | 12:91de57777095 | 40 | |
shivanandgowdakr | 12:91de57777095 | 41 | |
shivanandgowdakr | 12:91de57777095 | 42 | |
shivanandgowdakr | 12:91de57777095 | 43 |