Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 5 months ago.
How do I reset the time printed by pressing the user button?
I am working with the Nucleo F303RE and the online compiler and have the following code that is printing to the serial port:
- include "mbed.h"
int main() { set_time(1511827200); Set RTC time to Tue, 28 Nov 2017 00:00:00
while (true) { time_t seconds = time(NULL);
printf("Time = %s", ctime(&seconds));
char buffer[32]; strftime(buffer, 32, "%I:%M %p\n", localtime(&seconds));
wait(1); } }
How do I reset the time to 28 Nov 2017 00:00:00 with the press of the user button. The ID of this button is USER_BUTTON.
1 Answer
6 years, 5 months ago.
Well you start by ignoring the answer you got a week ago...
https://os.mbed.com/questions/81376/How-do-I-reset-the-time-printed-when-the/#answer14674