In my project I am using a Photon to control a servo via packages sent over the network. Thus, both the package handling and the servo control have to run in the main control loop. However, I would like to control the servo using not only position commands, but also via velocity commands e.g. move to position X at velocity V.
To do this, I was trying to measure the time passed during a loop iteration, and then update the position by Velocity*delta_time until the position is reached.
Since, I am not an expert on micro controller programming, I wanted to ask first if there is a preferred way of doing this on a Photon?