B+IMU+SD
Dependencies: BMI160 RTC SDFileSystem USBDevice max32630fthr
Fork of MPSMAXbutton by
RTClock.cpp@3:bd223559f79b, 2018-05-09 (annotated)
- Committer:
- FaizanAhmad
- Date:
- Wed May 09 11:01:18 2018 +0000
- Revision:
- 3:bd223559f79b
bUTTON+IMU+SD
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
FaizanAhmad | 3:bd223559f79b | 1 | #include "RTClock.h" |
FaizanAhmad | 3:bd223559f79b | 2 | extern Serial _serialport; |
FaizanAhmad | 3:bd223559f79b | 3 | |
FaizanAhmad | 3:bd223559f79b | 4 | void initRTC(){ |
FaizanAhmad | 3:bd223559f79b | 5 | time_t seconds = time(NULL); |
FaizanAhmad | 3:bd223559f79b | 6 | } |
FaizanAhmad | 3:bd223559f79b | 7 | |
FaizanAhmad | 3:bd223559f79b | 8 | void setRTCTime(){ |
FaizanAhmad | 3:bd223559f79b | 9 | |
FaizanAhmad | 3:bd223559f79b | 10 | } |
FaizanAhmad | 3:bd223559f79b | 11 | |
FaizanAhmad | 3:bd223559f79b | 12 | |
FaizanAhmad | 3:bd223559f79b | 13 | void loadNextMove(){ |
FaizanAhmad | 3:bd223559f79b | 14 | |
FaizanAhmad | 3:bd223559f79b | 15 | } |
FaizanAhmad | 3:bd223559f79b | 16 | |
FaizanAhmad | 3:bd223559f79b | 17 | void printRTCTime(){ |
FaizanAhmad | 3:bd223559f79b | 18 | time_t seconds = time(NULL); |
FaizanAhmad | 3:bd223559f79b | 19 | _serialport.printf("Time as seconds since January 1, 1970 = %d\n", seconds); |
FaizanAhmad | 3:bd223559f79b | 20 | _serialport.printf("Time as a basic string = %s", ctime(&seconds)); |
FaizanAhmad | 3:bd223559f79b | 21 | char buffer[32]; |
FaizanAhmad | 3:bd223559f79b | 22 | strftime(buffer, 32, "%I:%M %p\n", localtime(&seconds)); |
FaizanAhmad | 3:bd223559f79b | 23 | _serialport.printf("Time as a custom formatted string = %s", buffer); |
FaizanAhmad | 3:bd223559f79b | 24 | |
FaizanAhmad | 3:bd223559f79b | 25 | } |