This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

what is the principle of converting Ticks in to seconds

Hello

I am trying to change the ticks value of Battery measurement interval (ble_app-prox example) but i am not able to understand how the ticks period is measured based on what i understood from the example 1s is equal to 1000ms so totally we are setting it to120s then the ticks period is equal to 120000 if am wrong please correct me and explain me the correct method my aim to see the battery level changing based on the battery -measure_interval any help would be greatly appreciated

thankyou

Parents
  • I have a periodical temperature measurements in my application. For that i set up a timer like this:

    // Start application timers.
    err_code = app_timer_start(m_temperature_timer_id, TEMPERATURE_MEAS_INTERVAL, NULL);
    APP_ERROR_CHECK(err_code);
    

    And my TEMPERATURE_MEAS_INTERVAL is defined as follows:

    // Temperature measurement interval
    #define TEMPERATURE_MEAS_INTERVAL APP_TIMER_TICKS(RTC_IRQ_PERIOD_MS, APP_TIMER_PRESCALER)
    

    Here RTC_IRQ_PERIOD_MS = 5000. (With APP_TIMER_PRESCALER set to zero.) This configuration gives me measurement interval of 5s. So by changing RTC_IRQ_PERIOD_MS you can configure your timeout in milliseconds. Hope it helps.

Reply
  • I have a periodical temperature measurements in my application. For that i set up a timer like this:

    // Start application timers.
    err_code = app_timer_start(m_temperature_timer_id, TEMPERATURE_MEAS_INTERVAL, NULL);
    APP_ERROR_CHECK(err_code);
    

    And my TEMPERATURE_MEAS_INTERVAL is defined as follows:

    // Temperature measurement interval
    #define TEMPERATURE_MEAS_INTERVAL APP_TIMER_TICKS(RTC_IRQ_PERIOD_MS, APP_TIMER_PRESCALER)
    

    Here RTC_IRQ_PERIOD_MS = 5000. (With APP_TIMER_PRESCALER set to zero.) This configuration gives me measurement interval of 5s. So by changing RTC_IRQ_PERIOD_MS you can configure your timeout in milliseconds. Hope it helps.

Children
No Data
Related