How to extract the current time from the calendar_example, i am not clear with the procedure
How to extract the current time from the calendar_example, i am not clear with the procedure
Hi,
nrf_log module doesnt work now.. I am working on it, mean while can you please check this out..
this was the output when i used int datatype
EDIT : I am getting the same result using the character array pointer as well
below is the code i used for character array
char k[16]; for(int i = 0; i < sizeof(nrf_cal_get_time_string(true)); i++) { k[i] = nrf_cal_get_time_string(true)[i]; } err_code = ble_nus_data_send(&m_nus, k, &lendt, m_conn_handle);
Hi
How do you reset the time to start with?
I will try to merge the calendar example with the ble_app_uart example to see if I can reproduce your issue. You should hear from me soon ;)
Best regards
Torbjørn
Hi,
I don't know how to reset the time, But i did try the following function from the same library :
uint32_t year = 2020; uint32_t month = 8; uint32_t day = 14; uint32_t hour = 20; uint32_t minute = 5; uint32_t second = 55; nrf_cal_set_time(year, month, day, hour, minute, second);
But this gave me an error.
Thank you , I am awaiting for your reply
Hi again
I was able to merge the calendar functionality into ble_app_uart, and seem to be able to send time strings successfully.
The critical change I had to do was to modify nrf_calendar.h to use RTC2 instead of RTC0, since RTC0 is used by the SoftDevice and RTC1 is used by the app_timer module.
Here is the code for reference:
Best regards
Torbjørn
Hi, Thanks a lot i am able to get the right output now !!
I had another question, so does this time change real time? or does it remain constant?