Output the difference between a current and previous value

This example shows a simple way to calculate the difference between an incoming value, and the previously received value (for integers).

Chapter: 
Keywords: