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.
10 years, 9 months ago.
is it possible to vary the rate at which a Ticker calls a function continuously?
Hi
I have a program which measures an input sinusoidal waveform and calculates the period of the input waveform. I want to measure each period of my waveform exactly 32 times to get an accurate reading of the input waveform so I was taking my value of period and dividing it by 32 to get the rate at which I want to call my sampling function. In this program the period will vary and therefore I was wanting to know is it possible to attach a ticker to call my sampling function at a constantly changing time? I have tried to get this working without any success.
For example will this work:
ADC_set.attach(&ADC,ADC_sampling_rate); attach a ticker ADC-set to call ADC function at the sampling rate calculated (ADC_sampling_rate) to allow 32 samples per period
Thanks