Hi
I'm trying to implement some hysterisis on a program. What would be the fastest way to achieve this?
Say for example, my hysterisis on data received by thew ADC is 100.
What I want is to check if the data is larger OR smaller than the last received value by 100.
For example:
At startup:
Previous ADC_Reading = 877
my var = ADC_reading.
Main loop
if (ADC_reading => my var+100 =<100)
{
myvar = ADC_reading
}
else
{
do nothing
}
I'm a bit confused on how to achieve this for both positive and negative values. Any sugestions?