In a computer control system (microcontroller-based), the sampling time of the inputs to the system determine whether to treat the system as a discrete system or continuous. From what I have learnt, when \$t_s \rightarrow 0\$, you can treat the discrete control system as a continuous time system.
My question is, how do I implement what an op-amp integrator and differentiator would do on a microcontroller.
Differentiation - Can I simply calculate the gradient between adjacent sampled values, or is it more complicated?
Integration - Similarly, can I add up all the previous values which have been sampled?