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

Not sure if understand APP_TIMER_TICKS macro.

Hi,

I know that there is documentation, and that there are some answered questions abaut this, but still i dont think i understood how macro APP_TIMER_TICKS works. I need to read adc with frequency 500hz, and i2c with frequency 20hz. i am using NRF51DK with s110 soft device on it.

This is my code:

#define APP_TIMER_PRESCALER              0     
#define ADC_SAMPLING_INTERVAL                APP_TIMER_TICKS(2, APP_TIMER_PRESCALER)
#define I2C_SAMPLING_INTERVAL                APP_TIMER_TICKS(50, APP_TIMER_PRESCALER)

Is this configuration proper for my needs? If not, could someone simply explain how to use this macro?

Regards, Ina

Related