Mbed forum

Is it possible to update Ticker time value on the fly?

(Ian Harris) #1

I am very new to mbed and still finding my way around. I have never used C++ before either, so really starting behind the 8 ball.
I would like to use the Ticker function, but I would like to modify the elapsed time (in microseconds) in the callback function attached to the Ticker, so that each period is different. There is an Insert function in the documentation that appears to do this, but I don’t know how to code it. It’s a protected function inherited from TimerEvent., so it seems to me it should be available to classes derived from TimerEvent, such as Ticker, but how to access it?

(Ian Harris) #2

Can anyone provide an example of how to code the insert function?