can i genrate milliseconds using nrf calendar example?? that is only printing upto seconds i want milliseconds too??
can i genrate milliseconds using nrf calendar example?? that is only printing upto seconds i want milliseconds too??
Hi
I don't see why that should be a problem, but you'll have to implement that into the project, as it is not there by default. You can start out by checking out the while (true) loop in the main() function of the nrf_calendar example. There you can see how seconds and minutes are set, and you can implement milliseconds in a similar fashion. You will also have to edit the nrf_cal_get_time_string() function in nrf_calendar.c to use milliseconds as well.
Best regards,
Simon
in nrf_cal_get_time_string() hery are using this function strftime(cal_string,80,"%F-%H:%M;%S",nrf_cal_get_time()); to get the time and date but i dont know how are calculating date and time. and also there is no command to get millisecond in timer.h too
Hi
Yes, you will have to implement the millisecond parameter yourself in the nRF calendar example, as it is not a part of the calendar example by default. Please check out these previous DevZone tickets that clarify some general points on the calendar example, and answers some questions on the example itself.
Best regards,
Simon
can u please explain what does this function does return_time = m_time + CAL_RTC->COUNTER / 8;
Hi again
The return_time = m_time + CAL_RTC->COUNTER / 8; function stores the current timestamp in seconds. If you want to edit this to store in milliseconds instead, you will have to use the TIMER peripheral instead, as the RTC is not accurate enough to count milliseconds.
Best regards,
Simon