← All exercises

Rate of Change

medium

Reports how much an analog input changed over the last second, updating once per second.

What it teaches

Once per second, compare the input to where it was a second ago — the difference is the rate in units per second. Between ticks the output holds steady. A rising level gives a positive rate, a falling one negative; the faster the change, the bigger the number. The pattern behind rate alarms that catch a leak or a runaway heater before an absolute limit ever trips.

Inputs and outputs

TagTypeDefaultDescription
In_ValueREAL50Analog input to watch
Out_RateREALChange over the last second, in units per second

Required behavior